[python-win32] help writing text to a windows edit control
timr at probo.com
Wed Mar 24 23:43:03 CET 2010
Richard Leahy wrote:
> 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.
There should be no difference. If you can change the label on a button,
you should be able to change the text in an edit control, even if it is
read only. It's the same window message (WM_SETTEXT). You should not
need to open the process handle; Windows IPC should handle that.
Do you have the Windows SDK or Visual Studio? The "spyxx" tool should
let you look at the window tree structure of the application, to make
sure the edit control is really where you think it is.
Is this a simple test application you could send me?
> import os,sys,subprocess,time
> from subprocess import *
> from os import *
You really need to get out of that habit. What "from os import *" does
abort = os.abort
access = os.access
chdir = os.chdir
chmod = os.chmod
and so on, until every name from "os" is copied into your module. You
OR you do
from os import *
and the latter is virtually always a bad idea, because it fills your
namespace with all those foreign names, most of which you will never use.
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32