Results 1 to 4 of 4

Thread: Scroll Lock light

  1. #1

    Thread Starter
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41

    Scroll Lock light

    Hello,
    I am writing a program which does something once the scroll lock key is pressed. It then turns off the scroll lock light using the following code:
    Code:
    Private Sub ScrollLockOff()
        Dim abytBuffer(0 To 255) As Byte
        GetKeyboardState abytBuffer(0)
        abytBuffer(VK_SCROLL) = CByte(False)
        SetKeyboardState abytBuffer(0)
    End Sub
    The problem is this does not seem to turn scroll lock off, it only turns off the light. If I press and hold another key (shift for example) and scroll lock is supposed to be on (but turned off by this code) the scroll lock light starts flashing.
    Is there anything else I need to do to turn scroll lock off completely?

  2. #2

    Thread Starter
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41
    I think I have found the cause of this problem. It only occurs when the window is not active. However, I would like to run this program in the background. Is there any way to turn scroll lock off when the window is not active?

  3. #3

    Thread Starter
    Member Stef's Avatar
    Join Date
    May 2001
    Posts
    41

    Exclamation

    *bump*

    Anyone? I need to set the keyboard state, but my window is not the active window. Is this possible?

  4. #4

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width