com.jniwrapper.win32.ui
Class WindowProc

java.lang.Object
  extended by com.jniwrapper.Parameter
      extended by com.jniwrapper.Callback
          extended by com.jniwrapper.win32.ui.WindowProc
All Implemented Interfaces:
com.jniwrapper.PointerParameter

public class WindowProc
extends com.jniwrapper.Callback

This class represents default WINDOWPROC callback. Also, it provides ability to substitute window proc. of a specified window to enable custom message handling and processing.


Field Summary
protected  IntPtr _lParam
           
protected  IntPtr _lResult
           
protected  com.jniwrapper.UInt _msg
           
protected  Wnd _wnd
           
protected  IntPtr _wParam
           
 
Fields inherited from class com.jniwrapper.Callback
m
 
Fields inherited from class com.jniwrapper.Parameter
LICENSE_TYPE, V
 
Constructor Summary
WindowProc()
           
WindowProc(Wnd wnd)
           
 
Method Summary
 void addMessageListener(WindowMessageListener listener)
          Adds a specified window message listener.
 void callback()
           
 Wnd getWnd()
           
 boolean isSubstituted()
          Checks if native window procedure is substituted.
 void removeMessageListener(WindowMessageListener listener)
          Removes a specified listener.
 void restoreNative()
          Restores the window native procedure and disables custom message handling.
 void setWnd(Wnd wnd)
           
 void substitute()
          Substitutes a custom window procedure to enable window message handling.
 
Methods inherited from class com.jniwrapper.Callback
, a, callback, clone, createReturnValueByFields, dispose, getCallingConvention, getDebugInfo, getLength, getParameters, getReturnValue, init, isNull, isUseFieldsForCallbackParameters, read, restoreState, saveState, setCallingConvention, setUseFieldsForCallbackParameters, toPointer, write
 
Methods inherited from class com.jniwrapper.Parameter
a, a, acceptIOPerformer, asReturnValue, b, dataBufferAssigned, equals, getAlignedLength, getAlignmentRequirement, getDataBuffer, getDataBufferOffset, hashCode, indent, pop, push, read, read, setDataBuffer, toByteArray, write
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_wnd

protected Wnd _wnd

_msg

protected com.jniwrapper.UInt _msg

_wParam

protected IntPtr _wParam

_lParam

protected IntPtr _lParam

_lResult

protected IntPtr _lResult
Constructor Detail

WindowProc

public WindowProc(Wnd wnd)
Parameters:
wnd - is a handle of the window whose window procedure can be substituted.

WindowProc

public WindowProc()
Method Detail

callback

public void callback()
Specified by:
callback in class com.jniwrapper.Callback

addMessageListener

public void addMessageListener(WindowMessageListener listener)
Adds a specified window message listener.

Parameters:
listener -

removeMessageListener

public void removeMessageListener(WindowMessageListener listener)
Removes a specified listener.

Parameters:
listener -

substitute

public void substitute()
Substitutes a custom window procedure to enable window message handling.

Remember to call restoreNative() method to avoid problems during closing a window.

Throws:
java.lang.RuntimeException - if fails to substitute window procedure, for example, when trying to substitute procedure of a window, which was created by another process.

restoreNative

public void restoreNative()
Restores the window native procedure and disables custom message handling. This method must be called after substituting window procedure using the substitute() method.


isSubstituted

public boolean isSubstituted()
Checks if native window procedure is substituted.

Returns:
true if native procedure is substituted; otherwise false.

getWnd

public Wnd getWnd()

setWnd

public void setWnd(Wnd wnd)