- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have a QWIN program that uses a DLL which sends status and progress events.
The events are registered using RegisterWindowsMessage.
In order to react to these messages I have set up a hook like this:
use ifwin, only: SetWindowsHookEx, GetCurrentThreadId, WH_GETMESSAGE ! ... m_hHook = SetWindowsHookEx(WH_GETMESSAGE, %LOC(V3MessagesHook), 0, GetCurrentThreadId())
The signature of the V3MessagesHook function is like this:
integer(4) function V3MessagesHook(nCode, wparam, lparam) !DEC$ ATTRIBUTES STDCALL, DECORATE :: V3MessagesHook integer(4), intent(in) :: nCode, wParam, lParam !... end function
Compiling and running the program is no problem, the results are ok, too. But the V3MessagesHook function gets never called.
Using Spy++ I can see that the events I'm trying to get are fired alright.
Where am I going wrong?
TIA Felix
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In QuickWin, the UI thread is different from the thread running your code, so I suspect that using GetCurrentThreadID() won't work here. You may want to look at the Poker sample to see how it does subclassing. QuickWin is a somewhat strange environment and not all Windows API features may be usable.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page