windll and structure passing to Win32 API function

Thomas Heller theller at python.net
Tue Mar 18 03:32:00 EST 2003


"Constant" <rtconstant at sbcglobal.net> writes:

> I cannot find good tutorial or reference info on Sam Rushing's windll
> related procedures. I have read the books and searched the web very well.
> 
> Here is my specific prolem. I am working with the Win32 API function
> CreateProcess(), as the example for this posting. Some of its parameters are
> structures. I will use the last two, lpStartupInfo and lpProcessInformation
> to explain my problem.
> 
> First, I can create the two structures using Oracle(). I can receive
> information returned from a Win32 API function, such as,
> lpProcessInfomation.
> 
> Second, what I cannot figure out is how to pass information in a structure,
> like lpStartInfo. I can create it. But I do not know how to populate the
> structure with data to be passed. For example,
> I would like to set the elements dwX, dwY, dwXSize, and dwYSize to position
> the window created by the new process. I set the appropriate dwCreationFlags
> of the CreateProcess() function. My only problem (I hope) is how to set the
> appropriate members of the StatupInfo structure that I create and then pass
> this populated structure to CreateProcess().
> 
> My first desire is an answer to how to do what I just described, pass info
> in structures. I have successfully used similar structures in Win32 API
> functions that return info in structures.
> 
> My second desire is to know the location of any good tutorial and/or
> reference information on using windll. I have searched the example scripts
> and the web and the books, but such documentation, as I have found, is
> woefully inadequate.
> 
> Terry

You need ctypes:
http://starship.python.net/crew/theller/ctypes.html

Thomas




More information about the Python-list mailing list