Re: PostMessage and NULL HWND's

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

 



After about 5 seconds of thinking, I solved the problem -
you've got to love Windows' descriptive function names like
GetCurrentThreadId!.

ChangeLog:
* Have PostMessage call PostThreadMessage when hwnd is NULL




>PostMessage fails if you pass in NULL as the HWND argument.
>According to the MSDN, a NULL HWND means "The function behaves
>like a call to PostThreadMessage with the dwThreadId parameter
>set to the identifier of the current thread." Currently,
>PostMessage tries to get the thread id of the hwnd, which of
>course fails since it's NULL in this case, and of course the
>error is Invalid Window Handle.
>
>It seems like a simple fix is a test if hwnd is NULL and calling
>PostThreadMessage with the right thread ID, but I don't know how
>to get the current thread's ID.  Any ideas/suggestions?
>
>-Steve
(See attached file: postmessage.diff)

Attachment: postmessage.diff
Description: Binary data


[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux