[python-win32] Help calling a windows function in user32
Richard Leahy
leahy_rich at hotmail.com
Tue Mar 23 17:01:31 CET 2010
Hey guys im having a little difficulty sending data to my C application through python. I have my test.exe that has a input box in a window. I am trying to populate the edit box with input i send to it through python. This is a far as I have been able to get so far. any help would be much appreciated.
import os,sys,subprocess,win32con
from subprocess import *
from os import *
from ctypes import *
from ctypes.wintypes import *
appPath=r'"C:\Dev-Cpp\windowsapp.exe"'
p = subprocess.Popen(appPath)
user32 = windll.user32
user32.SetDlgItemTextA(need to put the hwnd handle here i think??? not sure how this is done, 1, "some text") // this is a user32 function that sends text to my inputbox.
C code below for reference
CreateWindow( "edit", "",
WS_VISIBLE|WS_CHILD|WS_BORDER|ES_AUTOHSCROLL|ES_AUTOVSCROLL,
0, 0, 300, 20, hwnd, (HMENU)1, hThisInstance, NULL);
SetDlgItemTextA(hwnd, 1, "some text")
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20100323/a792a7b7/attachment.html>
More information about the python-win32
mailing list