jacexh Posted September 16, 2014 Share Posted September 16, 2014 (edited) Hi all, I'm trying to use ctypes to call the interfaces in AutoItX. e.g. Call AU3_WinGetText: import ctypes from ctypes.wintypes import *AUTOIT = ctypes.windll.LoadLibrary("AutoItX3.dll")def win_get_title(title, text="", buf_size=200): AUTOIT.AU3_WinGetTitle.argtypes = (LPCWSTR, LPCWSTR, LPWSTR, INT) AUTOIT.AU3_WinGetTitle.restypes = None rec_text = LPWSTR() AUTOIT.AU3_WinGetTitle(LPCWSTR(title), LPCWSTR(text), ctypes.cast(ctypes.byref(rec_text), LPWSTR), INT(buf_size)) res = rec_text.value return resprint win_get_title("[CLASS:Notepad]") I'm getting a ValueError when execute these codes. res = rec_text.value ValueError: invalid string pointer 0x680765E0 Edited September 16, 2014 by jacexh 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