PostMessage (hWnd = 0)
-
-
i have a keyboard filter function: LRESULT CALLBACK KbHookProc(int, WPARAM, LPARAM); and a global variable: for example, HWND hWnd; then i set the value of the variable... but my function doesn't see this value and in this function hWnd is NULL why? :(
It's difficult to understand your exact problem. It looks to me like you have a global variable named hWnd but then you also have a local one of the same name. Please post some code so we can help you better. Regards, Alvaro
-
i have a keyboard filter function: LRESULT CALLBACK KbHookProc(int, WPARAM, LPARAM); and a global variable: for example, HWND hWnd; then i set the value of the variable... but my function doesn't see this value and in this function hWnd is NULL why? :(
Hello, the codegurus around the world.;) If you use Window API's PostMessage, you have to pass the window handle called HWND. If this HWND is NULL (0), this Window isn't created yet. That is, PostMessage function will not post this message. So, maybe you had better use if (hWnd), and use PostMessage Windows API function inside callback function?:rolleyes: Have a nice day!
-Masaaki Onishi-
-
i have a keyboard filter function: LRESULT CALLBACK KbHookProc(int, WPARAM, LPARAM); and a global variable: for example, HWND hWnd; then i set the value of the variable... but my function doesn't see this value and in this function hWnd is NULL why? :(
I think you should try a GetParent function wich is suppose to return the CWind* of the parent window. You can also have the hwind with (GetParent())->m_hWind