|
Hi,
I am using WM_COPYDATA message to send a string from one application to other but how can I do that, my code is here:
TCHAR *szPath=new TCHAR[g_szSelectedFilePath.GetLength()+1]();
memcpy(szPath,g_szSelectedFilePath,g_szSelectedFilePath.GetLength()*2);
delete[]szPath;
COPYDATASTRUCT cs;
cs.dwData=32;
cs.cbData=g_szSelectedFilePath.GetLength()*2;
cs.lpData=szPath;
::SendMessage(hWindow,WM_COPYDATA,NULL,(LPARAM)(LPVOID)(&cs));
what is the use of "cs.dwData=32" I could not find?
When I recive this message in other application only first 2 char are visible of the string and others are garbage chars.
|
|
|
|
|
|
You should really read this[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
As i see this, after you copied some string into your szPath you allocated you delete it and then pass the pointer which now points at the deleted memory area to the copydata.
The dwData member -as far as i know- is just a value you can pass over to the receiver, it can be anything that fits your needs.
|
|
|
|
|
Hai !
I have created a help file for my application using HTML help workshop, i
have a button named "Help" in my application, now when i press this button or press F1 key from keyboard, i want to open the help file that i have created !!
can you plz help me with the code required ??
Thankyou !
|
|
|
|
|
why not use ShellExecute?
|
|
|
|
|
|
|
it was a good link but how to
Step 8:
Import htmlhelp.lib to your application
Right click on the Resource Files then Add Files to Folder.
Select htmlhelp.lib.
on right click of Resource file i donot get "Add Files to Folder"
can you plz explain how to add htmlhelp.lib
thanks
|
|
|
|
|
You can improta lib files :Configuration Properties->Linker->Input and on the Additional Dependencies filed you must enter lib file.
|
|
|
|
|
Thanks I could get it !!
But what happens if i run my application in a different system, its registry will not be containing data which i have entered !!
|
|
|
|
|
Its easy make it . CRegKey
|
|
|
|
|
can i assign list box with 2 control variables?
1st is control variable is of COwnerDrawListBox type (custom list box) and 2nd i want to assign control variable of type CListBox?
i tried in this way but is it giving run time error?
plz help me.
thanks in advance
|
|
|
|
|
why do you want to do such a thing?
The two controls are of different type after all.
I guess, you want to have a functionality of CListBox and COwnerDrawListBox. Is it right? If affirmative you can simply override some functions in the derived class.
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
how can i add background color to a window using its handle. Anyone plz tell me.
|
|
|
|
|
|
I want to change the background color of child window.
I have created the Child Window using CreateWindow function. Now im having only the handle of the child window. Using the handle,How can i change the background color?
|
|
|
|
|
HWND hwnd=yourchildwindow
HDC hdc=::GetDC(hwnd);
SetBKcolor(hdc,RGB(53,97,200);
|
|
|
|
|
|
Wheres problem did you use of debugger hwnd is null or hdc?
|
|
|
|
|
hWnd and hdc is pointing to some value, not NULL.
|
|
|
|
|
|
Return value of CreateWindow.
|
|
|
|
|
|
Roay wrote: hi
Hi !
|
|
|
|