홈 · 개발 참고자료

개발 참고자료

[파워빌더] Set or Unset the keyboard numlock and read its state

작성자
관리자
작성일
2016-10-16
조회
9611
분류
파워빌더
This code will toggle the keyboard NUM LOCK state.OleObject wsh
Integer li_rc

wsh = CREATE OleObject
li_rc = wsh.ConnectToNewObject( "WScript.Shell" )

wsh.SendKeys("{NUMLOCK}")

See this HowTo for a list of special keys that can be used (like CAPSLOCK).To read the NUM LOCK state


[local function declaration]
FUNCTION int GetKeyState(int keystatus) LIBRARY "user32.dll"

[powerscript]

int li_keystate

li_keystate = GetKeyState(144)

IF li_keystate = 1 THEN
MessageBox("", "NUMLOCK on")
ELSEIF li_keystate = 0 THEN
MessageBox("", "NUMLOCK off")
END IF