SendKeys not working on Windows 10 Solved

Page 3 of 3 FirstFirst 123
  1.    08 Aug 2016 #21

    Antoops said: View Post
    I am also having similar issue with my program which was working windows 7 and not in windows 10. My requirement is to keep my machine not to get screen locked, so i am keep on sending NUMLOCK on every 5 seconds to keep it alive. So with this requirement, how can i replace sendkeys to something else? Please point if you see any solutions
    SendKeys are locked in Win 10 and 8.1 by the UAC.
    If you need to use Sendkeys you may want to try Disabling it in the Registry :
      My ComputerSystem Spec

  2.    19 Jan 2017 #22

    SendKeys does not work, but it appears the API function SendInput does.

    If you're in VB6, copy/paste this code into a module:

    Private Type KEYBDINPUT
    wVk As Integer
    wScan As Integer
    dwFlags As Long
    Time As Long
    dwExtraInfo As Long
    End Type
    Private Type GENERALINPUT
    dwType As Long
    xi(0 To 23) As Byte
    End Type
    Private Const INPUT_KEYBOARD = 1
    Private Declare Function SendInput Lib "user32.dll" (ByVal nInputs As Long, pInputs As GENERALINPUT, ByVal cbSize As Long) As Long
    Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (pDst As Any, pSrc As Any, ByVal BYTELEN As Long)

    ' Overrides VBA.SendKeys, which throws Permission Denied error in Windows 10
    Public Function SendKeys(ByVal Text As String)
    Dim n As Long
    For n = 1 To Len(Text)
    SendKeysA Asc(Mid(Text, n, 1))
    End Function

    ' Send keycode
    Public Function SendKeysA(ByVal vKey As Integer)
    Dim GInput(0) As GENERALINPUT
    Dim KInput As KEYBDINPUT

    KInput.wVk = vKey
    GInput(0).dwType = INPUT_KEYBOARD
    CopyMemory GInput(0).xi(0), KInput, Len(KInput)
    Call SendInput(1, GInput(0), Len(GInput(0)))
    End Function
      My ComputerSystem Spec

Page 3 of 3 FirstFirst 123

Related Threads
typically i see the beats loggo in my task bar, but since ive upgraded to windows 10 i havent... when i searched for it and tried to run the program Windows pops up a 'missing shortcut' message saying "Windows is searching for IDTNC54.cpl. To...
Anyone have Windows 10 working in Drivers and Hardware
with a mobile NVidia 7600 card?
windows 10 map app not working in Software and Apps
This is on a dell venue pro 11 tablet with windows 10 pro. I downloaded an offline map in settings, then map app would not load. When I click on map, it pop up for 3 seconds then gone. I tried run App troubleshooter. It did not find any...
Hi All- First time posting here and fingers crossed. I have a new Alienware PC that came with Windows 8.1. Everything was working great. I went on vacation and came back last Saturday the 8th. Turned it on and let it run. I believe several...
Solved Get Windows 10 App Not Working in General Support
I do not have the get windows 10 app on my computer. The windows 10 icon has never appeared at the icon tray. My system is up to date. I have a genuine copy of windows. I have above the minimum PC specs. I have always been connected to the internet....
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 13:02.
Find Us