;============================================================================================================================================= ; Step_3.asm ;This program is capable of showing the possibility of playing with the characteristics of another window ;(C)I don't take any responsibility for the use of this program ; Zedr0n -- connection closed ;============================================================================================================================================= ;============================================================================================================================================= ; Options/Declarations ;============================================================================================================================================= .386 .model flat, stdcall option casemap:none include windows.inc include kernel32.inc include user32.inc includelib \masm32\lib\kernel32.lib includelib \masm32\lib\user32.lib ;============================================================================================================================================= ; Data segment ;============================================================================================================================================= .data ClassName db "SciCalc",0 WindowName db "Калькулятор",0 Caption db "Zedr0n's third step ERROR",0 Text db "Window not found",0 Text2 db "Menu not found",0 Success db "Number of menu items",0 ;============================================================================================================================================ ; Variables segment ;============================================================================================================================================ .data? hWnd HWND ? hMenu HMENU ? iCount dd ? ;============================================================================================================================================= ; Code segment ;============================================================================================================================================= .code start: invoke FindWindow,offset ClassName,offset WindowName mov hWnd,eax .if hWnd==0 invoke MessageBox,NULL,offset Text,offset Caption,MB_OK .else invoke GetMenu,hWnd mov hMenu,eax .if hMenu!=0 invoke GetMenuItemCount,hMenu mov iCount,eax add iCount,30h invoke MessageBox,NULL,offset iCount,offset Success,MB_OK .else invoke MessageBox,NULL,offset Text2,offset Caption,MB_OK .endif .endif invoke ExitProcess,NULL end start