Advertisement
Linda-chan

AJPapps - VNC Scroll Lock helper 1.00

Nov 26th, 2013
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Option Explicit
  2.  
  3. '====================================================================
  4. Public Sub Main()
  5.   asRegisterAppPath
  6.   InitCommonControls
  7.   If Not asIsInIDE Then asSetWindowResIconAll asGetThunderMainHandle(), IDI_APPICON
  8.  
  9.   DoIt
  10. End Sub
  11.  
  12. Private Sub DoIt()
  13.   Dim CmdLine As BStr
  14.  
  15.   CmdLine = asTrimEx(Command())
  16.   If CmdLine = "" Then
  17.     'MsgBox "Использование: " & App.EXEName & "[.EXE] CommandToExecute", vbInformation
  18.    asMsgBox "Использование: " & App.EXEName & "[.EXE] CommandToExecute", "A_MAIN"
  19.     Exit Sub
  20.   End If
  21.  
  22.   StartIt CmdLine
  23. End Sub
  24.  
  25. Private Sub StartIt(ByVal CmdLine As BStr)
  26.   Dim RC As Long
  27.  
  28.   If Not asIsKeyToggled(VK_SCROLL) Then PressScrollLock
  29.  
  30.   RC = asLaunchProcessAndWaitEx3(CmdLine)
  31.   If RC <> 0 Then
  32.     'MsgBox "Ошибка " & asGetErrorNumber(RC) & ": " & _
  33.            CRLF & asGetAPIErrorMessage(RC), vbCritical
  34.    asMsgBox "Ошибка " & asGetErrorNumber(RC) & ": " & _
  35.              CRLF & asGetAPIErrorMessage(RC), "A_MAIN"
  36.   End If
  37.  
  38.   PressScrollLock
  39. End Sub
  40.  
  41. Private Sub PressScrollLock()
  42.   keybd_event VK_SCROLL, 0, 0, 0
  43.   keybd_event VK_SCROLL, 0, KEYEVENTF_KEYUP, 0
  44. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement