it cannot find a User32 function
Michael C <[email protected]> Wed, 3 May 2017 16:19:09 -0700
| Newsgroups | gmane.comp.python.ctypes |
|---|---|
| Message-ID | <CANyKM1j7bScCvxcamB54PhbwjpyuZ-x38NzzGG7RXK+xY+bVBg@mail.gmail.com> |
--===============6199039064065782890==
Content-Type: multipart/alternative; boundary=001a1140b160337309054ea6e263
--001a1140b160337309054ea6e263
Content-Type: text/plain; charset=UTF-8
Hi all, I am trying to move the location and change the size of a window,
but the User32.FindWindow function cannot be found!
AttributeError: function 'FindWindow' not found
import ctypes
User32 = ctypes.WinDLL('User32', use_last_error=True)
window_name = 'Star Wars'
handle = User32.FindWindow(None, window_name )
print(handle)
User32.MoveWindow(handle, 0, 0, 1440, 900, False)
How do I fix this? Thanks!
--001a1140b160337309054ea6e263
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Hi all, I am trying to move the location and change t=
he size of a window, but the User32.FindWindow function cannot be found!</d=
iv><div><br></div><div><br></div>AttributeError: function 'FindWindow&#=
39; not found<br><div><br></div><div><br></div><div><br></div><div><br></di=
v><div><br></div><div><div>import ctypes</div><div>User32 =3D ctypes.WinDLL=
('User32', use_last_error=3DTrue)</div><div>window_name =3D 'St=
ar Wars'</div><div>handle =3D User32.FindWindow(None, window_name )</di=
v><div>print(handle)</div></div><div><br></div><div>User32.MoveWindow(handl=
e, 0, 0, 1440, 900, False)<br></div><div><br></div><div><br></div><div>How =
do I fix this?=C2=A0 Thanks!</div></div>
--001a1140b160337309054ea6e263--
--===============6199039064065782890==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
--===============6199039064065782890==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ctypes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ctypes-users
--===============6199039064065782890==--