Richard Leahy wrote:
> So basically your saying that if i just use this
>
> test = windll.user32.FindWindowA(None, "Windows App")
>
> if not test:
>     print "[*] cant find window"
>
> print test // which returns 7471154 the handle
>
> windll.user32.SetDlgItemTextA(test,1,"test")
>
> this doesn't seem to set my edit box with the value of test sorry if i
> am not making sense and thank you for your help.

It shouldn't be any more complicated than that.  I was under the
impression that SetDlgItemText marshaled the string pointer so it would
work between processes, but perhaps I am mistaken.  SetDlgItemInt should
CERTAINLY work -- perhaps you should try that first.

BTW, you don't need to use ctypes for this.  FindWindow, SetDlgItemText
and SetDlgItemInt are all exported from win32gui.

    import win32gui
    t = win32gui.FindWindow( None, "Windows App" )
    win32gui.SetDlgItemInt( t, 1, 37 )

-- 
Tim Roberts, [email protected]
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to