A message-only window enables you to send and receive messages. It is not visible, has no z-order, cannot be enumerated, and does not receive broadcast messages. The window simply dispatches messages.
WinStructs.INITCOMMONCONTRLSEX initcommoncontrlsex = new WinStructs.INITCOMMONCONTRLSEX();
initcommoncontrlsex.dwSize = initcommoncontrlsex.size();
initcommoncontrlsex.dwICC = Comctl32.ICC_STANDARD_CLASSES;
Comctl32.INSTANCE.InitCommonControlsEx(initcommoncontrlsex);
handle = User32.INSTANCE.CreateWindowEx(0, "STATIC", "", 0, 0, 0, 0, 0, null, 0, 0, null);
public int dwSize;
public int dwICC;
protected List<String> getFieldOrder() {
return Arrays.asList(new String[]{"dwSize", "dwICC"});
}
}
if (Tools.is64Bit())
Pointer previousFunction = User32RW.INSTANCE.SetWindowLongPtr(handle, GWLP_WNDPROC, listener);
else
Pointer previousFunction = User32RW.INSTANCE.SetWindowLong(handle, GWLP_WNDPROC, listener);
There's a comment in our codebase saying "if you use the WindowProc callback type for previousFunction, things crash sporadically. Keep it Pointer.". You have been warned, although I have no idea if 1) that warning is still relevant 2) that warning ever was relevant :)
Cheers,
Will