;============================================================================================================================================= ; step_15.asm ;We want to check whether NumLock is pressed now... ; Algorithm ;A1: Get the state of NumLock ;A2: Show the result ;(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 Caption db "Zedr0n's step #15",0 ON db "NumLock on!",0 OFF db "NumLock off!",0 ;============================================================================================================================================ ; Variables segment ;============================================================================================================================================ .data? ;============================================================================================================================================= ; Code segment ;============================================================================================================================================= .code start: A1: invoke GetKeyState,VK_NUMLOCK A2: .if eax==1 invoke MessageBox,NULL,offset ON,offset Caption,MB_OK .else invoke MessageBox,NULL,offset OFF,offset Caption,MB_OK .endif invoke ExitProcess,NULL end start