<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<span class="postbody">I am trying to write text into a windows edit
control using python. it seems to write to every control i try except
the edit box not sure if this is a security measure or not. here is my
code any help please.
</span><br><br><br>import os,sys,subprocess,time
<br>
from subprocess import *
<br>
from os import *
<br>
from ctypes import *
<br>
from ctypes.wintypes import *
<br>

<br>
PROCESS_ALL_ACCESS =     ( 0x000F0000 | 0x00100000 | 0xFFF )
<br>
kernel32 = windll.kernel32
<br>
pid      = sys.argv[1]
<br>

<br>
h_process = kernel32.OpenProcess( PROCESS_ALL_ACCESS, False, int(pid) )
<br>

<br>
if not h_process:
<br>
    print "[*] Couldn't acquire a handle to PID: %s" % pid
<br>
    sys.exit(0)
<br>

<br>
user32 = windll.user32
<br>
# parent window
<br>
window_handle = windll.user32.FindWindowA(None, "Windows App")
<br>

<br>

<br>
if not window_handle:
<br>
    print "[*] cant find window"
<br>

<br>
# 1 is the control id of the edit box child window
<br>
#below line has no effect on the control for some reason??
<br>
windll.user32.SetDlgItemTextA(window_handle, 1, "test") 
<br>

<br>
# 2 is the control id of a button
<br>
# this line works and changes the button text? not sure whats going on
<br>
windll.user32.SetDlgItemTextA(window_handle, 2, "test") 
                                          <br /><hr />Hotmail: Free, trusted and rich email service. <a href='https://signup.live.com/signup.aspx?id=60969' target='_new'>Get it now.</a></body>
</html>