Harold123
August 15th, 2005, 01:38 PM
How to start an external application from visual C++?
Thanks.
Thanks.
|
Click to See Complete Forum and Search --> : execute an external application Harold123 August 15th, 2005, 01:38 PM How to start an external application from visual C++? Thanks. ahoodin August 15th, 2005, 01:47 PM I use ShellExecute to execute the program, and MoveWindow to change the location of the window. HTH, ahoodin Harold123 August 16th, 2005, 12:08 AM Thanks. Is there a way to interact with the application instead of click the buttons of the application? PadexArt August 16th, 2005, 06:20 AM It very much depends on how the controlled application is written. If you have acces to its source code you could add all the support needed yourself: automation, tcp/ip server ( send commands thourgh sockets ), named pipes, mail slots etc. ahoodin August 16th, 2005, 11:08 AM Thanks. Is there a way to interact with the application instead of click the buttons of the application? Sounds like you want to do some tighter integration with their app. Well it is possible to make API Calls using their dlls. Check out LoadLibrary() and GetProcAddress(). Also In some cases multiple instances of an application will interact through a shared memory area in the DLL, shared user memory address gleaned from a device driver, other popular ways are COM, COM+, DCOM and OLE Automation. Codeguru has tutorials on all of these subjects. HTH, ahoodin Harold123 August 16th, 2005, 12:24 PM Thank you for all the information. The problem is that I do not have the source code of the application, and I need to send a message to the application so that I do not need to click the mouse or press the key board. Thanks. ahoodin August 16th, 2005, 01:22 PM Hmmm.... Well there is always CWnd::PostMessage() and CWindow::PostMessage(). Additionally you may want to look at your Active-X Objects. It may be that there is already an Active-X control that has the functionality of the main app. ahoodin MikeAThon August 16th, 2005, 04:50 PM It's very hard to control another application by synthesizing button clicks etc. The slightest change in the application, or a bad assumption about the state of setting of application preferences, and "bammo", it no longer works. With that as a caution, the most frequently used method uses the SendInput API, described at http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardinput/keyboardinputreference/keyboardinputfunctions/sendinput.asp Paul DiLascia wrote an article demonstrating the SendInput function, in his C++ Q&A column from the January 2005 MSDN magazine. You can read it here: http://msdn.microsoft.com/msdnmag/issues/05/01/CQA/ Mike Harold123 August 17th, 2005, 02:51 PM Thank you for all the answers. I used mouse_event( ) to control the mouse and it works fine. Thanks again. codeguru.com
Copyright Internet.com Inc., All Rights Reserved. |