- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need to close a graphics window with a right mouse click option. Currently the window closes when I hot enter. I was advised by Leo quite some time back that I need to use the SendMessage API with WM_Keydown message with VK_Return as the virtual keycode. I have gotten this far but need help with the VK_Return implementation. Can anyone please guide a novice like me a little more.
Thanks
Sumit
I need to close a graphics window with a right mouse click option. Currently the window closes when I hot enter. I was advised by Leo quite some time back that I need to use the SendMessage API with WM_Keydown message with VK_Return as the virtual keycode. I have gotten this far but need help with the VK_Return implementation. Can anyone please guide a novice like me a little more.
Thanks
Sumit
logi=.TRUE.
do while(logi)
bret=waitonmouseevent(MOUSE$RBUTTONDOWN,keystate,ixpos,iypos)
if (keystate == MOUSE$KS_RBUTTON) then
iret= Messageboxqq('Close Window ?','Mouse Action'C,MB$ICONEXCLAMATION.OR.MB$YESNO)
IF(IRET == MB$IDYES) then !call exit()
hWnd= GetHWNDQQ(5)
iret=Focusqq(5)
iret=SetActiveQQ(5)
iret=SendMessage(hWnD,WM_Keydown,0,0)
...
logi=.FALSE.
end if
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Should be
iret=SendMessage(hWnd, WM_KEYDOWN, VK_RETURN, 0)
(perhaps 1 as last argument). I don't guarantee that the method will work though.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Jugoslav,
Thanks for your response. It defintely encouraged me to think that I was on the right path. The following worked. Thanks again
Thanks for your response. It defintely encouraged me to think that I was on the right path. The following worked. Thanks again
iret=SendMessage(hWnD,WM_IME_Keydown,VK_RETURN,0)
![](/skins/images/06022F5BB6D2F28C8F102671A0F06E85/responsive_peak/images/icon_anonymous_message.png)
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page