No Sleep


Author: Dave
Date: 04.20.23 - 10:27pm



Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal ByteLen As Long)
Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, pInputs As INPUT_TYPE, ByVal cbSize As Long) As Long

Private Const MOUSEEVENTF_MOVE = &H1
Private Const INPUT_MOUSE = 0

Private Type MOUSEINPUT
  dx As Long
  dy As Long
  mouseData As Long
  dwFlags As Long
  dwtime As Long
  dwExtraInfo As Long
End Type

Private Type INPUT_TYPE
  dwType As Long
  xi(0 To 23) As Byte
End Type

Private inputEvent(0) As INPUT_TYPE

Function MouseMove0()

   Dim mouseEvent As MOUSEINPUT 'https://www.tek-tips.com/viewthread.cfm?qid=1458304
   Static initilized As Boolean
   
   If Not initilized Then
        mouseEvent.dx = 0 ' Load up the event record
        mouseEvent.dy = 0
        mouseEvent.mouseData = 0
        mouseEvent.dwFlags = MOUSEEVENTF_MOVE
        mouseEvent.dwtime = 0
        mouseEvent.dwExtraInfo = 0
        inputEvent(0).dwType = INPUT_MOUSE ' Copy the record into the input array
        CopyMemory inputEvent(0).xi(0), mouseEvent, Len(mouseEvent)
        initilized = True
   End If
   
   SendInput 1, inputEvent(0), Len(inputEvent(0))
 
End Function





Comments: (0)

 
Leave Comment:
Name:
Email: (not shown)
Message: (Required)
Math Question: 21 + 1 = ? followed by the letter: A 



About Me
More Blogs
Main Site
Posts: (All)
2024 ( 1 )
2023 (9)
     VB6 Virtual Files
     File handles across dlls
     python abort / script timeout
     py4vb
     VB6 Python embed w/debugger
     python embedding
     VB6 IDE Enhancements
     No Sleep
     A2W no ATL
2022 (4)
     More VB6 - C data passing
     Vb6 Asm listing
     Byte Array C to VB6
     Planet Source Code DVDs
2021 (2)
     Obscure VB
     VB6 IDE SP6
2020 ( 4 )
2019 ( 5 )
2018 ( 6 )
2017 ( 6 )
2016 ( 22 )
2015 ( 15 )
2014 ( 25 )
2013 ( 4 )
2012 ( 10 )
2011 ( 7 )
2010 ( 11 )
2009 ( 3 )