<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
Hi guys. I have been struggling with writing a string into an edit control using the windows api calls. What I have noticed is that if i write text to a different control like a button control for example it works. Is there something in place like a security thing that prevents writing to an edit control? code below. thanks. I have put my C code at the very bottom for reference. <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># parent window<br>window_handle = windll.user32.FindWindowA(None, "Windows App")<br><br>if not window_handle:<br> print "[*] cant find window"<br> sys.exit(0)<br><br>my_string = "testing"<br><br>windll.user32.SetDlgItemTextA(window_handle,1, my_string)<br><br><br><br>C CODE<br><br> hwnd = CreateWindowEx (<br> 0, /* Extended possibilites for variation */<br> szClassName, /* Classname */<br> "Windows App", /* Title Text */<br> WS_OVERLAPPEDWINDOW, /* default window */<br> CW_USEDEFAULT, /* Windows decides the position */<br> CW_USEDEFAULT, /* where the window ends up on the screen */<br> 544, /* The programs width */<br> 375, /* and height in pixels */<br> HWND_DESKTOP, /* The window is a child-window to desktop */<br> NULL, /* No menu */<br> hThisInstance, /* Program Instance handler */<br> NULL /* No Window Creation data */<br> );<br> <br><br><br> CreateWindow( "EDIT", "",<br> WS_VISIBLE|WS_CHILD,<br> 0, 0, 300, 50, hwnd, (HMENU)1, hThisInstance, NULL);<br><br> <br><br>CreateWindow( "BUTTON", "",<br> WS_VISIBLE|WS_CHILD|BS_PUSHBUTTON,<br> 0, 50, 100, 30, hwnd, (HMENU)2, hThisInstance, NULL);<br>                                            <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>