Button press simulation
-
Hi, How can a button press be simulated, so when you do the call you can see the button going down and up again, and the corresponding button handler gets called. I use the following code now. ((CButton *) GetDlgItem(IDC_MOD))->SendMessage(BM_CLICK); The button handler gets called, but the button doesn't go down and up again. Is there any other way to achief this ? Thx
-
Hi, How can a button press be simulated, so when you do the call you can see the button going down and up again, and the corresponding button handler gets called. I use the following code now. ((CButton *) GetDlgItem(IDC_MOD))->SendMessage(BM_CLICK); The button handler gets called, but the button doesn't go down and up again. Is there any other way to achief this ? Thx
-
Have you tried sending WM_LBUTTONDOWN+WM_LBUTTONUP (with proper point) ? I haven't tried it, but it seems to be the starting point of a button press... HTH :-O squidev
According to the MSDN documentation the BM_CLICK message generates a WM_LBUTTONDOWN and a WM_LBUTTONUP message. See : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttonreference/buttonmessages/bm\_click.asp I figured out that when I shift the focus to a button on a regular dialog and I hit the key no down and up movement is seen. Could it be possible that everything goes so fast that you cann't see it ?
-
According to the MSDN documentation the BM_CLICK message generates a WM_LBUTTONDOWN and a WM_LBUTTONUP message. See : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttonreference/buttonmessages/bm\_click.asp I figured out that when I shift the focus to a button on a regular dialog and I hit the key no down and up movement is seen. Could it be possible that everything goes so fast that you cann't see it ?
Why not just use Spy++ to see what messages are sent to the control and dialog? Once found, then it's just a matter of repeating them via code.
"Take only what you need and leave the land as you found it." - Native American Proverb
-
According to the MSDN documentation the BM_CLICK message generates a WM_LBUTTONDOWN and a WM_LBUTTONUP message. See : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/buttons/buttonreference/buttonmessages/bm\_click.asp I figured out that when I shift the focus to a button on a regular dialog and I hit the key no down and up movement is seen. Could it be possible that everything goes so fast that you cann't see it ?
try something like WM_GETDLGCODE , that might prevent the dialog from taking the focus from the controls ,and if it doesn't work then at design-time set the TAB order. Regards Farpointer