Interface ComponentPeerX
public interface ComponentPeerX extends ComponentPeer
{
// Methods
public int gethwnd();
public int getHwnd();
public int getNearestHwnd();
public int getTopHwnd();
public boolean isWindowless();
}
This interface is an abstract interface that extends the component peer.
The ComponentPeerX interface is used (instead of com.ms.awt.WComponentPeer, for example) when accessing a peer object's HWNDs.
This support is significant for Microsoft® J/Direct technology, as the windowless component support for the Microsoft packages makes it more difficult to retrieve window handles (HWNDs) for Java components that interact with native Win32 code.
ComponentPeer
|
+--ComponentPeerX
public int gethwnd();
Retrieves the Win32 window handle that is directly associated with the peer's component, if any.
Return Value:
Returns the HWND of the Win32 window for this peer.
Remarks:
Both getHwnd and gethwnd methods are supported in this interface for backwards compatability.
Exceptions:
IllegalStateException
if the peer does not have its own HWND and is using a parent component's HWND.
public int getHwnd();
Retrieves the Win32 window handle that is directly associated with the peer's component, if any.
Return Value:
Returns the HWND of the Win32 window for this peer.
Remarks:
Both getHwnd and gethwnd methods are supported in this interface for backwards compatability.
Exceptions:
IllegalStateException
if the peer does not have its own HWND and is using a parent component's HWND.
public int getNearestHwnd();
Retrieves the nearest Win32 window handle associated with a component. If the component has its own HWND, then that is returned; otherwise, the handle associated with the nearest component in the parent chain is returned.
Return Value:
Returns the HWND of the nearest Win32 window in the parent chain.
public int getTopHwnd();
Retrieves the top-level parent HWND in the parent chain. This is the outermost handle used by the system to host the component.
Return Value:
Returns the HWND of the top-level parent Win32 window in the parent chain.
public boolean isWindowless();
Queries a peer to determine if it is windowless. If the component is using a parent component's window handle, the component is windowless.
Return Value:
Returns true if the component is using a parent component's window handle; otherwise, returns false if the component is directly associated with an HWND.