findwindowex

Why doesn't FindWindowEx find all my buttons?

喜夏-厌秋 提交于 2020-07-22 08:33:34
问题 I'm supposed to write an automatic Installer. Just a programme you start and it should go through the installation wizard all by itself, without the user touching anything. The programme I'm working on at the moment is called Cygwin. And what I want to do is just click the "Next" Button over and over again until the installation is finished. I know I could use a VBS and I know I could use C# and that would make life quite a bit easier for me. But I have an example of how it could work for

Why doesn't FindWindowEx find all my buttons?

本秂侑毒 提交于 2020-07-22 08:33:14
问题 I'm supposed to write an automatic Installer. Just a programme you start and it should go through the installation wizard all by itself, without the user touching anything. The programme I'm working on at the moment is called Cygwin. And what I want to do is just click the "Next" Button over and over again until the installation is finished. I know I could use a VBS and I know I could use C# and that would make life quite a bit easier for me. But I have an example of how it could work for

python selenium+pywin32+winspy64工具 完成百度上传图片识图功能

ⅰ亾dé卋堺 提交于 2020-01-07 13:17:23
import win32guiimport win32confrom selenium import webdriverimport timedef main(): driver = webdriver.Chrome() driver.maximize_window() driver.implicitly_wait(10) driver.get("http://www.baidu.com") driver.find_element_by_css_selector(".soutu-btn").click() str_js = 'document.getElementsByClassName("upload-pic")[0].click()' driver.execute_script(str_js) # 一定要等待windows窗口打开,再用pywin32api操作窗口 time.sleep(5) # 一级顶层窗口,此处title为上传窗口名称,浏览器不一样上传窗口名称不一样 dialog_1 = win32gui.FindWindow("#32770", "打开") # 二级窗口 dialog_2 = win32gui.FindWindowEx(dialog_1, 0, "ComboBoxEx32", None) # 三级窗口 dialog_3 = win32gui

day36(1224):鼠标、键盘、下拉列表、js操作(上传文件)

限于喜欢 提交于 2019-12-28 23:33:44
""" 1、autoIt - .au3 - 2、SendKeys 3、pywin32 """ import win32gui import win32con # edit - combox - comboBoxEx32 - #32770 # 1\找到输入框和打开按钮 元素;2、输入地址,点击打开。 # 前提 :windows上传窗口已经出现。sleep1-2秒等待弹出的出现。 def upload ( filePath , browser_type = "chrome" ) : if browser_type == "chrome" : title = "打开" else : title = "" #找元素 #一级窗口"#32770","打开" dialog = win32gui . FindWindow ( "#32770" , title ) # ComboBoxEx32 = win32gui . FindWindowEx ( dialog , 0 , "ComboBoxEx32" , None ) #二级 comboBox = win32gui . FindWindowEx ( ComboBoxEx32 , 0 , "ComboBox" , None ) #三级 #编辑按钮 edit = win32gui . FindWindowEx ( comboBox , 0 ,

Finding a MessageBox in a specific app?

别等时光非礼了梦想. 提交于 2019-12-24 13:07:13
问题 We have implemented a solution to give our internal users a nag message that they need to redeploy our application. We are using the filesystem watcher to monitor the network and look for a change in a specific file which has worked very well. Most of the functionality has been implemented in a base form class that most of the forms of our application inherit from. A new message box will be displayed every five minutes until the redeploy the app. It nags them enough that its effective in

FindWindowEx on child dialog window

非 Y 不嫁゛ 提交于 2019-12-24 03:41:29
问题 I'm trying to get the handle of a child dialog window. I've tried using FindWindowEx, but it didn't work. Instead, FindWindow did work. I did an experiment with visual studio's options window, with the following code: IntPtr vsHandle = Process.GetProcessById(vsProcessId).MainWindowHandle; // consistent with spy++'s parent handle of options window IntPtr optionsHandle = FindWindowEx(vsHandle, IntPtr.Zero, "#32770", "Options"); // returns 0 IntPtr optionsHandle2 = FindWindow("#32770", "Options"

用C#打造\"QQ对战平台挤房器\"

半腔热情 提交于 2019-12-19 01:58:26
一、什么是“QQ对战平台挤房器”? 喜欢在“QQ对战平台”或“浩方对战平台”玩游戏的人都知道。平常平台上的房间基本很多都是人满的,如果想找个房间,那可是要费好长的时间来“挤”才能进去,如果是节假日或晚上,那更要花费更多的时间在“挤”房上了,如下图: 而对于“QQ对战平台”,如果房间已满挤不进去,却变态的还会弹出两次提示!平时,就只有拼命的按“回车键”或“空格键”关闭这两个讨厌的弹出窗口,然后再用鼠标点房间,如果房间还是进不去,就只能再按上面来一次循环……一次、两次不是问题;五次、十次也许还不是问题;但如果十几次或上百次还是挤不进去,还手按那就有问题了!当然,如果你喜欢手虐那就另外说了-_-# 我不喜欢手虐,所以当有次碰到N次还是挤不进去时,我就在想,为什么不写个工具来代替我的手,用工具自动去帮我“挤”房间,帮我点那两个讨厌的提示窗口呢?于是这篇文章中的“QQ对战平台挤房器”就这样诞生了(这可解放多少人的双手啊,大家鼓掌……) 二、“挤房”要怎样“挤”? 上面说了,“挤房器”就是帮我们自动“挤”房,但是它要怎么帮我们“挤”呢?它毕竟是机器,而不是人,它不会自动一看到房间就帮我们“挤”,除非我们给它定制了一套规则(也可以叫命令)。机器就是机器,有规则它才会去做事,如果没规则也会做事,那它就是“人”(智能机器人?)了。 这规则要怎样定制?让我们先来看看我们平时进入房间的流程,如下图:

winfrom实现控件全屏效果

我们两清 提交于 2019-12-18 00:38:09
用常规方法实现全屏显示时,由于采用的三方控件导致界面顶端一直有一条半透明的类似标题栏的东西无法去除,原因一直没找到。 下面综合整理下网上两位博主的用WindowsAPI实现全屏的方法: 控件全屏显示: http://www.cnblogs.com/lmcblog/archive/2012/07/14/2591501.html 任务栏、开始菜单栏显示隐藏:http://www.cnblogs.com/ITBread/p/3503801.html 我把代码整理下,方便下次自己查看 1、任务栏、菜单栏的显示与隐藏 [DllImport("user32.dll")] public static extern bool GetCursorPos(ref Point lpPoint); [DllImport("user32.dll", EntryPoint = "FindWindowEx", SetLastError = true)] public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); [DllImport("user32.dll", EntryPoint = "ShowWindow",

C# FindWindowEx Obtain parameter for lpszClass variable by WinSpy++ not work

走远了吗. 提交于 2019-12-11 11:26:31
问题 PROBLEM This is my function to send key stroke in background. class SendMessage { [DllImport("user32.dll")] public static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow);

C# get child handles using FindWindowEx by name and ordinal number

匿名 (未验证) 提交于 2019-12-03 01:29:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: According to http://msdn.microsoft.com/en-us/library/ms633500(v=vs.85).aspx I define FindWindowEx function. using System.Runtime.InteropServices; [DllImport("user32.dll", CharSet=CharSet.Unicode)] static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); Now I am able to find first handle of "Button" control (get name from Spy++) setting childAfter as IntPtr.Zero . IntPtr hWndParent = new IntPtr( 20 32496); // providing parent window handle IntPtr hWndButton = FindWindowEx(hWndParent,