flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
ly47 07 Sep 2019, 17:57
Hi
BM_CLICK message checks if left moude button been clicked on a control. BUT How to check if the right mouse button been clicked ? Thanks ly |
|||
![]() |
|
donn 07 Sep 2019, 18:29
https://docs.microsoft.com/en-us/windows/win32/inputdev/wm-rbuttondown
The message is WM_RBUTTONDOWN or 0x0204 Is this what you mean? You can also handle scenarios where you want the screen coords also, multiple buttons are pressed, etc. I have a pen tablet and touch tablet and last used a setup like this: Code: .wmPointerEnter: cmp rdx, 249h jne windowMsgs.wmPointerLeave ; (Skip/switch) ;Handle message mov rax, 0 jmp windowMsgs.completed .wmPointerLeave: cmp rdx, 24Ah jne windowMsgs.wmPointerUp ; (Skip/switch) ;Handle message mov rax, 0 jmp windowMsgs.completed .wmPointerUp: cmp rdx, 247h jne windowMsgs.wmPointerDown ; (Skip/switch) ;Handle message mov rax, 0 jmp windowMsgs.completed .wmPointerDown: cmp rdx, 246h jne windowMsgs.wmPointerUpdate ; (Skip/switch) ;Handle message mov rax, 0 jmp windowMsgs.completed .wmPointerUpdate: cmp rdx, 245h jne windowMsgs.wmUpdate ; (Skip/switch) ;Handle message mov rax, 0 jmp windowMsgs.completed Been a while since I looked at this though, may not be what you're looking for. Going to revisit this message handling soon too, will post any updates or tweaks if I find any. Good luck... |
|||
![]() |
|
ly47 07 Sep 2019, 18:46
Hi
Thanks for your reply. I tried WM_RBUTTONDOWN and it works only for the main window on any control it does nothing. ly |
|||
![]() |
|
donn 07 Sep 2019, 19:21
I see, not a Controls expert, sorry. Perhaps this:
https://docs.microsoft.com/en-us/windows/win32/controls/wm-notify is a clue? wm_notify looks like a generic Control Message. This link shows it sending nm_rclick from a different Controll: https://stackoverflow.com/questions/21770905/right-click-on-listview-winapi-c (Remy Lebeau's comment) Have to log off for the day, maybe that's a clue if you're still wanting to resolve and stuck. Have a good one. |
|||
![]() |
|
ly47 08 Sep 2019, 06:58
Hi again
Attached test asm file for right click Not working on controls only on window itself.
|
|||||||||||
![]() |
|
AsmGuru62 08 Sep 2019, 14:08
A better way in this case is a message called WM_CONTEXTMENU.
I added few lines into your code (marked with AG62). Run the code in debugger and watch the debugger output window. Or, if you not using debugger (weird, because you should) - replace OutputDebugString() with MessageBox(). Right click on any control will cause some printout. Right click on window itself will not cause the printout, because you intercepted right click and did not let Windows handle it.
|
|||||||||||
![]() |
|
AsmGuru62 08 Sep 2019, 15:56
This: https://docs.microsoft.com/en-us/windows/win32/menurc/wm-contextmenu
The HWND of a thing which was clicked is a value of WPARAM. Compare it with return values from CreateWindowEx() calls you did to create buttons. |
|||
![]() |
|
ly47 08 Sep 2019, 17:34
Hi again AsmGuru62
I tried to comapre wParam to return values from CreateWindowEx() calls I did to create buttons. And nothing happened. Attached your modified file. Thank for your help ly
|
|||||||||||
![]() |
|
ly47 08 Sep 2019, 18:25
Hi again AsmGuru62
Problem solved Attached modified file Thanks ly
|
|||||||||||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.