|
-
Feb 14th, 2010, 08:18 AM
#1
Thread Starter
Addicted Member
WM_COPYDATA Help Please
i'm using vc6
i'm trying to make SendMessage with WM_COPYDATA send to other application
but dont' know how to do struct
this is the info i'm trying to send
(WPARAM) (HWND) (LPARAM)
how do i make this into string like -> 26589|2134|122345
thankx
-
Feb 19th, 2010, 02:09 PM
#2
Member
Re: WM_COPYDATA Help Please
Hey,
Code:
string myString;
myString = "26589|2134|122345";
COPYDATASTRUCT cds;
cds.cdData = sizeof(myString);
cds.lpData = &myString;
cds.dwData = 0x1234;
HWND hHwnd;
hHwnd = FindWindow("Notepad", NULL);
SendMessage(hHwnd, WM_COPYDATA, (WPARAM)"SOMETHINGHERE", (LPARAM)&cds);
It depends on what the application is expecting as to what you should send it. If it's expecting a string, then something like that would work, although you're going to have to set your string up the way you want it.
If it's expecting a custom struct then something different would be required.
-
Mar 10th, 2010, 03:13 AM
#3
Thread Starter
Addicted Member
Re: WM_COPYDATA Help Please
26589<---hwnd
2134<----wparam
122345<--lparam
how to get them into string?
-
Mar 12th, 2010, 05:55 AM
#4
Member
Re: WM_COPYDATA Help Please
Code:
HWND hWnd = (HWND)26589;
WPARAM wParam = (WPARAM)2134;
LPARAM lParam = (LPARAM)122345;
char pString[256] = "";
sprintf(pString, "%i|%i|%i", hWnd, wParam, lParam);
COPYDATASTRUCT cds;
cds.cbData = sizeof(pString);
cds.lpData = &pString;
cds.dwData = 0x1234;
HWND hHwnd;
hHwnd = FindWindow("Notepad", NULL);
SendMessage(hHwnd, WM_COPYDATA, (WPARAM)"SOMETHINGHERE", (LPARAM)&cds);
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
|