Global Const $VK_NUMLOCK = 0x90, $GUI_EVENT_CLOSE = -3, $GUI_SHOW = 16, $GUI_HIDE = 32 #NoTrayIcon Func msgCheck() Select Case $Message = $GUI_EVENT_CLOSE GUIDelete() Exit Case $Message = $NumLock Return "{NUMLOCK}" Case $Message = $Divide Return "{NUMPADDIV}" Case $Message = $Multiply Return "{NUMPADMULT}" Case $Message = $Subtract Return "{NUMPADSUB}" Case $Message = $7 Return "{NUMPAD7}" Case $Message = $8 Return "{NUMPAD8}" Case $Message = $9 Return "{NUMPAD9}" Case $Message = $Plus Return "{NUMPADADD}" Case $Message = $4 Return "{NUMPAD4}" Case $Message = $5 Return "{NUMPAD5}" Case $Message = $6 Return "{NUMPAD6}" Case $Message = $1 Return "{NUMPAD1}" Case $Message = $2 Return "{NUMPAD2}" Case $Message = $3 Return "{NUMPAD3}" Case $Message = $Enter Return "{NUMPADENTER}" Case $Message = $0 Return "{NUMPAD0}" Case $Message = $Decimal Return "{NUMPADDOT}" Case $Message = $End Return "{END}" Case $Message = $Down Return "{DOWN}" Case $Message = $PgDn Return "{PGDN}" Case $Message = $Left Return "{LEFT}" Case $Message = $Blank Return "" Case $Message = $Right Return "{RIGHT}" Case $Message = $Home Return "{HOME}" Case $Message = $Up Return "{UP}" Case $Message = $PgUp Return "{PGUP}" Case $Message = $Ins Return "{INSERT}" Case $Message = $Del Return "{DELETE}" EndSelect Return "" EndFunc Func GetNum () Local $ret = DllCall ( "user32.dll", "long", "GetKeyState", "long", $VK_NUMLOCK ) Return $ret[0] EndFunc Func ChangeSet( ) If GetNum() = 1 AND $z <> 1 Then $z = 1 GUICtrlSetState ( $1, $GUI_SHOW ) GUICtrlSetState ( $2, $GUI_SHOW ) GUICtrlSetState ( $3, $GUI_SHOW ) GUICtrlSetState ( $4, $GUI_SHOW ) GUICtrlSetState ( $5, $GUI_SHOW ) GUICtrlSetState ( $6, $GUI_SHOW ) GUICtrlSetState ( $7, $GUI_SHOW ) GUICtrlSetState ( $8, $GUI_SHOW ) GUICtrlSetState ( $9, $GUI_SHOW ) GUICtrlSetState ( $0, $GUI_SHOW ) GUICtrlSetState ( $Decimal, $GUI_SHOW ) GUICtrlSetState ( $End, $GUI_HIDE ) GUICtrlSetState ( $Down, $GUI_HIDE ) GUICtrlSetState ( $PgDn, $GUI_HIDE ) GUICtrlSetState ( $Left, $GUI_HIDE ) GUICtrlSetState ( $Blank, $GUI_HIDE ) GUICtrlSetState ( $Right, $GUI_HIDE ) GUICtrlSetState ( $Home, $GUI_HIDE ) GUICtrlSetState ( $Up, $GUI_HIDE ) GUICtrlSetState ( $PgUp, $GUI_HIDE ) GUICtrlSetState ( $Ins, $GUI_HIDE ) GUICtrlSetState ( $Del, $GUI_HIDE ) ElseIf GetNum() = 0 AND $z <> 0 Then $z = 0 GUICtrlSetState ( $1, $GUI_HIDE ) GUICtrlSetState ( $2, $GUI_HIDE ) GUICtrlSetState ( $3, $GUI_HIDE ) GUICtrlSetState ( $4, $GUI_HIDE ) GUICtrlSetState ( $5, $GUI_HIDE ) GUICtrlSetState ( $6, $GUI_HIDE ) GUICtrlSetState ( $7, $GUI_HIDE ) GUICtrlSetState ( $8, $GUI_HIDE ) GUICtrlSetState ( $9, $GUI_HIDE ) GUICtrlSetState ( $0, $GUI_HIDE ) GUICtrlSetState ( $Decimal, $GUI_HIDE ) GUICtrlSetState ( $End, $GUI_SHOW ) GUICtrlSetState ( $Down, $GUI_SHOW ) GUICtrlSetState ( $PgDn, $GUI_SHOW ) GUICtrlSetState ( $Left, $GUI_SHOW ) GUICtrlSetState ( $Blank, $GUI_SHOW ) GUICtrlSetState ( $Right, $GUI_SHOW ) GUICtrlSetState ( $Home, $GUI_SHOW ) GUICtrlSetState ( $Up, $GUI_SHOW ) GUICtrlSetState ( $PgUp, $GUI_SHOW ) GUICtrlSetState ( $Ins, $GUI_SHOW ) GUICtrlSetState ( $Del, $GUI_SHOW ) EndIf EndFunc Global $z = 2 $Gui = GUICreate ( "Number Pad", 250, 310, -1, -1, 0x14CA0000, 0x08040108 ) ; Styles fetched from XPs VK $NumLock = GUICtrlCreateButton ( "NumLock", 10, 10, 50, 50 ) $Divide = GUICtrlCreateButton ( "/", 70, 10, 50, 50 ) $Multiply = GUICtrlCreateButton ( "*", 130, 10, 50, 50 ) $Subtract = GUICtrlCreateButton ( "-", 190, 10, 50, 50 ) $Plus = GUICtrlCreateButton ( "+", 190, 70, 50, 110 ) $Enter = GUICtrlCreateButton ( "Enter", 190, 190, 50, 110 ) $1 = GUICtrlCreateButton ( "1", 10, 190, 50, 50 ) $2 = GUICtrlCreateButton ( "2", 70, 190, 50, 50 ) $3 = GUICtrlCreateButton ( "3", 130, 190, 50, 50 ) $4 = GUICtrlCreateButton ( "4", 10, 130, 50, 50 ) $5 = GUICtrlCreateButton ( "5", 70, 130, 50, 50 ) $6 = GUICtrlCreateButton ( "6", 130, 130, 50, 50 ) $7 = GUICtrlCreateButton ( "7", 10, 70, 50, 50 ) $8 = GUICtrlCreateButton ( "8", 70, 70, 50, 50 ) $9 = GUICtrlCreateButton ( "9", 130, 70, 50, 50 ) $0 = GUICtrlCreateButton ( "0", 10, 250, 110, 50 ) $Decimal = GUICtrlCreateButton ( ".", 130, 250, 50, 50 ) $End = GUICtrlCreateButton ( "End", 10, 190, 50, 50 ) $Down = GUICtrlCreateButton ( "↓", 70, 190, 50, 50 ) $PgDn = GUICtrlCreateButton ( "PgDn", 130, 190, 50, 50 ) $Left = GUICtrlCreateButton ( "←", 10, 130, 50, 50 ) $Blank = GUICtrlCreateButton ( " ", 70, 130, 50, 50 ) $Right = GUICtrlCreateButton ( "→", 130, 130, 50, 50 ) $Home = GUICtrlCreateButton ( "Home", 10, 70, 50, 50 ) $Up = GUICtrlCreateButton ( "↑", 70, 70, 50, 50 ) $PgUp = GUICtrlCreateButton ( "PgUp", 130, 70, 50, 50 ) $Ins = GUICtrlCreateButton ( "Ins", 10, 250, 110, 50 ) $Del = GUICtrlCreateButton ( "Del", 130, 250, 50, 50 ) GUISetState() ChangeSet() While 1 $Message = GUIGetMsg() $x = msgCheck() If $x <> "" Then Send ($x) ChangeSet() EndIf WEnd