flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
typedef 06 Dec 2010, 16:06
Hello fasm.net, I got a question here.
I want to capture a notification (TCN_SELCHANGE) event in Win32 code, as seen here http://msdn.microsoft.com/en-us/library/ms933405.aspx To do so you have to cast LPARAM to NMHDR inorder to get the results. In C++, its Code: case WM_NOTIFY: switch( ((NMHDR*)lParam)->code ){ case TCN_SELCHANGE: //Tab control selection has changed ... etc I was thinking if maybe its not possible I could just use a timer to check which tab is selected. But I want to know how to cast for future reference. How does casting work in ASM. if anyone has done it before or knows how to implement it in FASM. Please let me know. Thanks. |
|||
![]() |
|
typedef 08 Dec 2010, 03:05
Thanks mindcooler you cooled my mind, however the code did not work.
When I clicked on another Tab it did not swtich to it. But I fixed it. All I did was XORed EAX between and it worked. But it wouldn't have worked without your help though, so thank you so much. Here's how I changed it. Code: mov eax,[lparam] cmp [eax+NMHDR.code],TCN_SELCHANGE je .change xor eax,eax ; I added this line jmp ._done .change: invoke MessageBox,[hwnd],'Tab selection has changed','Notice',MB_OK ._done: jmp .def It seems like the data in EAX was not flushed from the previous section during the jump. But it works now. Thanks again, mindcooler, You cooled my mind.lol |
|||
![]() |
|
mindcooler 08 Dec 2010, 07:27
I don't see why you need to clear eax unless you return at .def.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.