sudhakar_koundinya
asked on
Sending BN_CLICKED message using SendMessage or PostMessgae
Hi All,
Can any body give me a solution in which I need to post/send BN_Clicked message using SendMessage or PostMessage methods
I have tried like this. But they are not working.
SendMessage(h, WM_COMMAND, 0, BN_CLICKED);
PostMessage(h, WM_COMMAND, 0, BN_CLICKED);
Thanks
Sudhakar
Can any body give me a solution in which I need to post/send BN_Clicked message using SendMessage or PostMessage methods
I have tried like this. But they are not working.
SendMessage(h, WM_COMMAND, 0, BN_CLICKED);
PostMessage(h, WM_COMMAND, 0, BN_CLICKED);
Thanks
Sudhakar
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
::SendMessage(hwnd, WM_COMMAND, MAKELONG(GetDlgCtrlID(h), BN_CLICKED), h);
or
::PostMessage(hwnd, WM_COMMAND, MAKELONG(GetDlgCtrlID(h), BN_CLICKED), h);
But I Get following error
StdAfx.cpp
error C2664: 'SendMessageA' : cannot convert parameter 4 from 'struct HWND__ *' to 'long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
error C2664: 'PostMessageA' : cannot convert parameter 4 from 'struct HWND__ *' to 'long'
This conversion requires a reinterpret_cast, a C-style cast or function-style cast
Error executing cl.exe.