-
April 24th, 2008, 03:18 AM
#1
passing a value from one exe to another
Hi all,
I have two exe's. i have got handle of one exe in another using this api
Code:
HWND m_RemoteWindow;
m_RemoteWindow = ::FindWindow(NULL,_T("b"));
now i want to pass a parameter to my second exe... i have got handle for it...
How can i do so.....
I have to pass parameter from one exe to another and retrieve that parameter in second exe
-
April 24th, 2008, 03:23 AM
#2
Re: passing a value from one exe to another
use PostMessage (wparam,lparam) to send the parameters
-
April 24th, 2008, 04:01 AM
#3
Re: passing a value from one exe to another
There are several ways for it, Google some information for 'interprocess communication'.
If amount of data is small, you can send it by COPYDATA-message.
example (might or might not work 100%):
Code:
COPYDATASTRUCT lpCopyData;
int iVariable=2;
lpCopyData.dwData = 1;
lpCopyData.cbData = sizeof(int);
lpCopyData.lpData = (LPVOID)&iVariable;
::SendMessage(Handle, WM_COPYDATA, NULL, (LPARAM)(LPVOID)(&lpCopyData));
'You help me, and I, in turn, am helped by you!'
-H.S.
-
April 24th, 2008, 04:14 AM
#4
Re: passing a value from one exe to another
Originally Posted by VCProgrammer
Hi all,
I have two exe's. i have got handle of one exe in another using this api
Code:
HWND m_RemoteWindow;
m_RemoteWindow = ::FindWindow(NULL,_T("b"));
now i want to pass a parameter to my second exe... i have got handle for it...
How can i do so.....
I have to pass parameter from one exe to another and retrieve that parameter in second exe
There are various ways, shared memory, named pipes, etc. You can search for it on the web, there are enough articles on the topic.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|