guestgulkan, did you read the post in that link of yours? Sounds strange to me that the guy is passing the ID from GetCurrentThreadId(). If the message box belongs to the current thread, wouldn't that mean the thread is blocked in the modal loop of the message box, meaning this code cannot run???
I would imagine that the procedure works but from a different thread, not the thread that created the dialog box. Right?