in reply to
How to set text to text boxes?
I'm not sure how RDC is implemented under the hood, but if I substitute VNC, you can't do that. A VNC window is a flat pixel canvass. The individual addressable controls you see are on the remote machine, not your machine. I dont think there are any User32.dll recognized buttons in that window for you to click. Try Winspector Spy http://web.archive.org/web/20080822214746/http://www.windows-spy.com/download/, use the red gunscope thing, drag it over your RDC window. A red border around the selected control will show up. See if you can isolate individual controls out of that RDC window. If you can not, the entire large RDC window is the smallest addressable thing, and it is not "a button". Your only choice is to synthesize keyboard keys or X,Y coord mouse clicks inside that window. You also didn't check the return value of PushChildButton as per http://www.piotrkaluski.com/files/winguitest/docs/ch09s55.html. If you read the source https://metacpan.org/source/KARASIK/Win32-GuiTest-1.60/lib/Win32/GuiTest.pm#L791 you will see "the button" was clicked at 0,0. If your "button" is the entire window. The synthesized click landed nowhere near your human seen button in that window.