dcsimg

How to get the window handle under the Microsoft JVM?

Davanum Srinivas

import java.awt.*;
import java.awt.peer.*;
import com.ms.awt.peer.*;  

class DrawingCanvas extends java.awt.Canvas
{

  void viewZoomBy(double Factor)
  {
    ....
    ComponentPeer p = this.getPeer();
    if( p != null )
    {
        ComponentPeerX peer1 = (ComponentPeerX)p;
        CompHwnd = peer1.gethwnd();  // Microsoft specific method
    }
    ....
  }
}