robotgo icon indicating copy to clipboard operation
robotgo copied to clipboard

The process ID is not available

Open qq1792569310 opened this issue 1 year ago • 0 comments

  • Robotgo version (or commit ref): "v1.00.0.1189, MT. Baker!"
  • Go version: 1.21.5
  • Gcc version: 11.2.0
  • Operating system and bit: windows11 64
  • Resolution:
  • Can you reproduce the bug at Examples:
    • [ ] Yes (provide example code)
    • [ ] No
    • [x] Not relevant
  • Provide example code:
//get the current process ID
pid := robotgo.GetPid()
//get the title of the current window
title := robotgo.GetTitle()   // succeed
//Pass in the process ID to get the window title
title2:=robotgo.GetTitle(pid)   // fail
//Press A once
robotgo.KeyTap("a")   // succeed
//Pass in the process ID and press A once
robotgo.KeyTap("a", pid)   // fail

Description

In the above code, functions that do not pass in the process ID can be executed normally, for example, 'title' can get the correct title, and the key A can also be triggered normally. However, when the process ID is passed, the obtained 'title' is an empty string, and the key 'A' will not be triggered normally

qq1792569310 avatar Mar 01 '24 05:03 qq1792569310