The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: Force on March 03, 2012, 12:08:20 AM

Title: Run Another Program
Post by: Force on March 03, 2012, 12:08:20 AM
I made this project by using FindWindow,FindWindowEx Methods

Main program send a text message to EditBox of target program and pushing button of it

and text message is in MessageBox of target program.

hope it helps to anybody

Force
Title: Re: Run Another Program
Post by: qWord on March 03, 2012, 12:55:56 AM
Sending WM_CHAR to simulate user input is an bad technique and may cause strange behaviour of the target Application. Use SendInput+SetFocus  instead.
Title: Re: Run Another Program
Post by: donkey on March 03, 2012, 01:03:06 AM
Hi Force,

qWord is correct, do not use WM_CHAR unless you also use AttachThreadInput to synchronize the two threads input queues otherwise the results are unpredictable. You might want to look into the WM_COPYDATA (http://msdn.microsoft.com/en-us/library/windows/desktop/ms649011%28v=vs.85%29.aspx) message for passing information between programs.

You should explore ways to accomplish the same task without having to rely on Windows marshalling, as UIPI becomes more restrictive with each successive version of Windows you may find that your programs will fail.
Title: Re: Run Another Program
Post by: Force on March 03, 2012, 11:31:10 AM
Thanks qWord n Edgar

yeah i felt something was wrong in it but I couldnt find it

Force
Title: Re: Run Another Program
Post by: Force on March 03, 2012, 11:03:19 PM
I got a new idea
is it possible to login in this forum programatically?
sending username , password and click login button like my project

thanks
Force
Title: Re: Run Another Program
Post by: dedndave on March 04, 2012, 12:08:26 AM
probably, if you are an expert with PHP   :P
Title: Re: Run Another Program
Post by: Gunner on March 04, 2012, 12:38:08 AM
You don't need PHP.  Just plain ole sockets or WinInet.
Title: Re: Run Another Program
Post by: dedndave on March 04, 2012, 01:09:02 AM
oh - i thought all that was PHP stuff   :P