flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
ManOfSteel
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. |
|||
![]() |
|
FrozenKnight
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 |
|||
![]() |
|
Adam Kachwalla
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? |
|||
![]() |
|
resoftw
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 ![]() _________________ ![]() ^_^ |
|||
![]() |
|
sinsi
You mean something like a notification code?
Quote:
|
|||
![]() |
|
FrozenKnight
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 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.