Hawlong Posted February 21, 2021 Share Posted February 21, 2021 i use this library in Python import win32com.client import time autoit = win32com.client.Dispatch("AutoItX3.Control") How to use this function hwnd() in python Link : https://www.autoitscript.com/autoit3/docs/functions/HWnd.htm Not found hwnd() here AutoItX.chm Link to comment Share on other sites More sharing options...
Danp2 Posted February 21, 2021 Share Posted February 21, 2021 Appears that function isn't available in AutoItX, so you won't be able to use it in Python. Hawlong 1 Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Hawlong Posted February 21, 2021 Author Share Posted February 21, 2021 6 hours ago, Danp2 said: Appears that function isn't available in AutoItX, so you won't be able to use it in Python. mmm okay , i found another solution v = "0x007A08F6" le = "[HANDLE:%s]" % v this code work good , Maybe someone need it Please do you have any idea how to convert this functionhttps://www.autoitscript.com/autoit3/docs/libfunctions/_WinAPI_ScreenToClient.htm To work in Python Link to comment Share on other sites More sharing options...
Danp2 Posted February 21, 2021 Share Posted February 21, 2021 If you look at the underlying code for _WinAPI_ScreenToClient, you'll find that it calls ScreenToClient from user32.dll. Seems like this offers the same thing for python. Latest Webdriver UDF Release Webdriver Wiki FAQs Link to comment Share on other sites More sharing options...
Hawlong Posted February 21, 2021 Author Share Posted February 21, 2021 (edited) 43 minutes ago, Danp2 said: If you look at the underlying code for _WinAPI_ScreenToClient, you'll find that it calls ScreenToClient from user32.dll. Seems like this offers the same thing for python. i use it but There is a problem hwnd = win32gui.FindWindow( None,"Untitled - Notepad") print(type(hwnd)) hwnd type is int , and output : 7997686 when i use this handle = 7997686 not work , only accept title "Untitled - Notepad" Edited February 21, 2021 by Hawlong Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now