flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Borsuc 07 Mar 2006, 21:02
IIRC you need WM_KEYDOWN or WM_KEYUP or WM_CHAR for keyboard, not WM_COMMAND. Or did I misunderstand something? Post some code, maybe there's an easier way?
|
|||
![]() |
|
Reverend 07 Mar 2006, 21:34
Win32 Reference wrote: WM_COMMAND Let's say you have your WinProc defined like: hwnd, umsg, wparam, lparam. So: hwnd = hwnd ![]() umsg = WM_COMMAND wparam.hiword = notification code wparam.loword = item id lparam = control's hwnd I suggest checking first the 'umsg' value for WM_COMMAND and then 'lparam' for the handle of listbox (or whatever). If both compares match you can be sure that someone clicked/focused/etc. on your listbox ![]() |
|||
![]() |
|
Rayslava 08 Mar 2006, 06:31
Code: proc WindowProc, hwnd,wmsg,wparam,lparam push ebx esi edi mov eax,[wmsg] ... cmp eax,WM_COMMAND je wmcommand ... That's beginning of windowproc. Code: wmcommand: mov ebx,[lparam] cmp ebx,[edithwnd] je edit And this part also works fine. Code: edit: cmp [wparam],WM_LBUTTONDOWN je about jmp finish And I have a suspicion, that in this part I'd use Quote: wNotifyCode = HIWORD(wParam); I've read the manual, but what I have to compare NotifyCode with? It's clear to me that my bug is hiding over here, but... |
|||
![]() |
|
shoorick 08 Mar 2006, 08:52
for me it is not clear what exactly you do and what exactly you wish to do. what "edithwnd" means if you say about there is a list box? and what WM_COMMAND are you expecting from listview? zip your code please and post, and tell specific what behavior you are expecting of it.
regards! |
|||
![]() |
|
shoorick 08 Mar 2006, 08:54
wNotifyCode = HIWORD(wParam); >
movzx eax,word [wParam + 2] |
|||
![]() |
|
Rayslava 08 Mar 2006, 09:48
Quote:
I get WM_COMMAND message, I can filter messages from my listbox, using lparam and then Program should select if the message is WM_LBUTTONDOWN or another... So my only problem is to get WM_message number from wparam. For example there is a notify Message BN_CLICKED, but what messages I should check to get mouse clicks, keyboard buttons and how to convert wmNotify codes to WM_messages? For example, how could I get a key that was pressed in the listbox window?
|
|||||||||||
![]() |
|
Reverend 08 Mar 2006, 19:56
Possible wNotfyCode values: (check win32 reference for their meaning)
LBN_DBLCLK LBN_ERRSPACE LBN_KILLFOCUS LBN_SELCANCEL LBN_SELCHANGE LBN_SETFOCUS Example. Let's say you want to catch when someone doubleclicks on your listbox. First, catch WM_COMMAND (in [umsg]), then check listbox handle (in [lparam]) and then LBN_DBLCLK (in word [wparam + 2]). If all these conditions are met - someone doubleclicked the listbox. And something from my coding experience. Most of the time I just skip wNotifyCode checking. Usually I just process the message if it's WM_COMMAND and if the handle match. But if you must eg. differ between single- and doubleclick then freely try the combination with wNotifyCode. |
|||
![]() |
|
shoorick 09 Mar 2006, 05:54
as far as i know there is no WM_COMMAND sent to the parent window when you press a key within the list box: that message will be sent by buttons, accelerators, menus. to catch listview notification messages you have to process WM_NOTIFY message: check for LVN_KEYDOWN for key pressed.
|
|||
![]() |
|
shoorick 09 Mar 2006, 06:13
when enter pressed in listview and not processed by it, then WM_COMMAND with wParam=IDOK will sent to the parent window. to catch VK_RETURN in listview you have to subclass listview and return DLGC_WANTALLKEYS to WM_GETDLGCODE message in subclassed routine. check there: http://board.flatassembler.net/topic.php?t=4786
|
|||
![]() |
|
Rayslava 09 Mar 2006, 10:22
Thanks
|
|||
![]() |
|
shoorick 09 Mar 2006, 13:45
as well as i've been mixing listbox and listview and thus misguided you a little, so, here is my little help: a box working i think as well as you hope (just not with colour). also, i saw your source: you have to use FindClose when you finish use handle with FindNext.
_________________ UNICODE forever! |
|||||||||||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.