January 1, 2005

WinTask - LockScrollLock

'
' LockScrollLock
'
' Force the ScrollLock Key to be locked, if it isn't already
'
' Author: Joe Strazzere
'

VK_SCROLL = 145
Key_Down = 0
Key_Up = 2

ret=External("user32","GetKeyState", VK_SCROLL)

if ret = 0 then
    External("user32.dll","keybd_event", VK_SCROLL, 0, Key_Down, 0) ' ScrollLock Key down
    External("user32.dll","keybd_event", VK_SCROLL, 0, Key_Up, 0) ' ScrollLock Key up
EndIf