discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Q] (Win32) On adding custom windows message to the NSRunLoop


From: Sungjin Chun
Subject: [Q] (Win32) On adding custom windows message to the NSRunLoop
Date: Thu, 14 Jun 2012 16:29:51 +0900

Hi,

I want to use 3rd party dll with GNUstep but struck with a problem;
the dll needs a
window handle(HANDLE) for its event processing, for example, if I want
to receive
realtime event notification, I have to write this kind of code;

in WinMain function I have to use following windows message loop

HANDLE hwnd = CreateWindow(.../* ordinary window creation */);
while (GetMessage(...)) {
  TranslateMessage(...);
  DispatchMessage(...);
}

On other part, I have to register
XXX_registerEventHandler(hwnd, WM_USER + MY_EVENT_ID);

then, the dll emits windows message event WM_USER + MY_EVENT_ID so that
I can handle the data in WndProc(which is lpfnWndProc for hwnd).

Now my question is that I can get handle of a window from NSWindow>>nativeHandle
method, but how can I register event handler(NSRunLoop, right?) for
WM_USER + MY_EVENT_ID?

Thanks in advance and sorry for my poor english.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]