Git Product home page Git Product logo

Comments (8)

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

@huo-feng-ding updated

from vd.ahk.

huo-feng-ding avatar huo-feng-ding commented on July 27, 2024

代码里有个 Send "q" 这个是否可以去掉,在有个应用下边切换的时候因为这个没切过去

from vd.ahk.

huo-feng-ding avatar huo-feng-ding commented on July 27, 2024

我试了 去了 send “q”, 但是在TIM.exe,xyplorer.exe等一些应用下边还是切换不了桌面

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

change Sleep 10 to Sleep 100, does it fix it ?

Send "q" can be replaced by any letter, it is needed to set keyboard focus to hWnd

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

actually, change the whole function so there are 2 Sleep:

  static _WinActivate_CreateRemoteThread(hWnd) {
    foregroundWindow := DllCall("GetForegroundWindow", "Ptr")
    threadID := DllCall("GetWindowThreadProcessId", "Ptr", foregroundWindow, "Uint*", &PID := 0)
    currentThreadID := DllCall("GetCurrentThreadId")
    if (threadID != currentThreadID) {
      hThread := DllCall("OpenThread", "Uint", 0x0002, "Int", 0, "Uint", threadID)
      DllCall("SuspendThread", "Ptr", hThread)
      hProcess := DllCall("OpenProcess", "Uint", 0x0002, "Int", 0, "Uint", PID, "Ptr")
      user32 := DllCall("GetModuleHandleA", "AStr", "user32", "Ptr")
      SetForegroundWindow := DllCall("GetProcAddress", "Ptr", user32, "AStr", "SetForegroundWindow", "Ptr")
      DllCall("CreateRemoteThread", "Ptr", hProcess, "Ptr", 0, "Ptr", 0, "Ptr", SetForegroundWindow, "Ptr", hWnd, "Uint", 0, "Ptr", 0)
      Sleep 100
      Send "q"
      Sleep 100
      DllCall("ResumeThread", "Ptr", hThread)
      DllCall("CloseHandle", "Ptr", hThread)
      DllCall("CloseHandle", "Ptr", hProcess)
    }
  }

from vd.ahk.

huo-feng-ding avatar huo-feng-ding commented on July 27, 2024

换上了边的代码也不行,TIM.exe在窗口激活的情况下,去切换不起作用,切不过去

from vd.ahk.

FuPeiJiang avatar FuPeiJiang commented on July 27, 2024

我用xyplorer.exe切换不了, 可以不用下载TIM.exe了, 谢谢bug report

XYplorer Trial Version
ThunderRT6FormDC
XYplorer.exe
0x16C00080
0x00000109

XYplorer
ThunderRT6FormDC
XYplorer.exe
0x06CF0000
0x00040100

XYplorer
ThunderRT6Main
XYplorer.exe
0x94090000
0x00000080

___

This PC - XYplorer ### 30-Day Trial Version - Day 1 ### - 24.40.0100
ThunderRT6FormDC
XYplorer.exe
0x16CF0000
0x00040100

XYplorer
ThunderRT6Main
XYplorer.exe
0x94090000
0x00000080

from vd.ahk.

huo-feng-ding avatar huo-feng-ding commented on July 27, 2024

借助SetForeGroundWindow.exe切换桌面没有问题了,谢谢

from vd.ahk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.