flat assembler
Message board for the users of flat assembler.
Index
> Windows > Child inside child controls? |
Author |
|
ManOfSteel 24 Aug 2007, 11:21
Isn't the 'standard' WindowProc way working for you?
You can check the hwnd to know which control is being used and then umsg to know what it's doing. It's all there. |
|||
24 Aug 2007, 11:21 |
|
FrozenKnight 24 Aug 2007, 11:28
Well there are 2 ways one. some messages are sent to the controls parent window. the other requires subclassing.
below is part of one of my sources where i subclassed a window. (the window was used as a hex edit control. Code: proc InitDlg hDlg push 0 push 8 push EM_LIMITTEXT push DlgEdithexWnd push [hDlg] call [SendDlgItemMessage] push DlgEdithexWnd ;* push [hDlg] ;* call [GetDlgItem] ;*this gets the window from the dialog push hexnum ;push window proc interceptor push GWL_WNDPROC push eax ;push window handle call [SetWindowLong] mov [prcOrgEdit], eax ;save origonal proc address you will need to ;you will need to pass messages here after your ;done with them. unless you do all the handling your self. ret endp |
|||
24 Aug 2007, 11:28 |
|
Adam Kachwalla 24 Aug 2007, 22:00
ManOfSteel: I am not sure how to get the control hwnd and find out what event is there. I think I tried getting the hwnd from [hwnd] and message from [wmsg] but it didn't work:
Code: proc WindowProc hwnd,wmsg,wparam,lparam push ebx esi edi cmp [wmsg],WM_VSCROLL je .wmVSCROLL cmp [wmsg],WM_HSCROLL je .wmHSCROLL cmp [wmsg],WM_CREATE je .wmcreate cmp [wmsg],WM_SIZE je .wmsize cmp [wmsg],WM_SETFOCUS je .wmsetfocus cmp [wmsg],WM_RBUTTONDOWN je .wmRBDown cmp [wmsg],WM_COMMAND je .wmcommand cmp [wmsg],WM_DESTROY je .wmdestroy .defwndproc: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] jmp .finish It only seems to recognize events from the direct child controls (WINDOW\CHILD, not WINDOW\CHILD\CHILD) Can you explain a little further? FrozenKnight: So what are the references to DlgEdithexWnd and hDlg about? |
|||
24 Aug 2007, 22:00 |
|
resoftw 30 Aug 2007, 15:47
it's just my thought,I dont know if it works but how about using WS_EX_CONTROLPARENT in ExStyle of the parent control..
if it doesnt a subclassing like ManOfSteel said is the way, I guess _________________ Loading my signature, please wait... ^_^ |
|||
30 Aug 2007, 15:47 |
|
sinsi 30 Aug 2007, 16:01
You mean something like a notification code?
Quote:
|
|||
30 Aug 2007, 16:01 |
|
FrozenKnight 31 Aug 2007, 09:37
when you create the control it returns it's hwnd. if it's in a Dialog you can get the hwnd from it's identifier using GetDlgItem.
example (From one of my programs where i created a floating point edit box) Code: push IDI_FLOATNUMBER push [hdlg] call [GetDlgItem] push fltedit_proc push GWL_WNDPROC push eax call [SetWindowLong] cmp eax, 0 jz .wmclose mov [proc_edit], eax |
|||
31 Aug 2007, 09:37 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.