findwindow

多窗口下的批量操作脚本 - 利用win32gui和WindowSpy++简单实现目标窗口前置

匿名 (未验证) 提交于 2019-12-02 22:51:08
环境:python 3.7.x 使用的模块:pyautogui, win32gui 使用的工具:WindowSpy++ 1. 鼠标键盘动作模拟的模块(包)选择 百度到的键鼠模拟包主要有 PyUserInput 和 pyautogui 两个包可选,具体如下:   pyautogui:  windows下可直接pip install pyautogui 两者都可以实现丰富的键鼠操作,但我在尝试UserInput的时候遇到了一些问题:不同系统的键盘名称有区别,但不太好找到windows对应的键盘名称表。 * 在使用pyautogui的过程中,我遇到了一些问题,如反复使用pyautogui.hotkey('ctrl','v')来模拟Ctrl+V热键的时候,有一定的概率出错。我的解决方式是十分笨拙的手动模拟: 1 import pyautogui as pg 2 3 pg.keyDown('ctrl') 4 pg.press('v') 5 pg.keyUp('ctrl') 2.多窗口下切换前置窗口 本着少做调查研究的原则,我本来是打算用模拟键盘alt+tab的方法直接实现切换窗口的,甚至计算了多个窗口下置换前置的排列组合方法。但是……天若OCR是一个联网才能使用的工具,在 [识别 - 跳出结果窗口] 的时间里,窗口的排列顺序是不确定的,所以多次反复的tab下结果总是不稳定…

FindWindow FindWindowEx

两盒软妹~` 提交于 2019-12-02 14:58:28
问题 I have written a program that is to find a box in another program and set focus to it. Once this is done it will sendkeys and save to this box. I am using Findwindow and FindwindowEx to locate the box, but I have a bit of an issue. if you notice the windows are the same all the way down to the first TPanel. Now after that there are 3Tpanel Classes. After 3Tpanel Classes there are multiple TttgEdit Classes. How do I teach the program which Classes I want to select? Here is my code thus far.

FindWindow FindWindowEx

依然范特西╮ 提交于 2019-12-02 04:04:16
I have written a program that is to find a box in another program and set focus to it. Once this is done it will sendkeys and save to this box. I am using Findwindow and FindwindowEx to locate the box, but I have a bit of an issue. if you notice the windows are the same all the way down to the first TPanel. Now after that there are 3Tpanel Classes. After 3Tpanel Classes there are multiple TttgEdit Classes. How do I teach the program which Classes I want to select? Here is my code thus far. Delcare Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As IntPtr) As Long Private

Findwindow and SendMessage

笑着哭i 提交于 2019-12-02 04:03:56
Hey all i am trying to figure out why this is not sending a ALT+F to notepad! Private Declare Function FindWindow1 Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Const WM_KEYUP = &H101 Private Const WM_KEYDOWN = &H100 Private Const WM_SYSKEYDOWN = &H104 Private Sub Command_Click() Dim parenthwnd As Long Dim hwnd As Long parenthwnd = FindWindow1(vbNullString, "Untitled - Notepad") retvalue = SendMessage(parenthwnd, WM_SYSKEYDOWN, VK_MENU, 1&) retvalue = SendMessage(parenthwnd, WM_KEYDOWN, VK_F, 1&) End Sub I get a value for