Microsoft
Software
Hardware
Network
Question : Windows messaging
I have a single windows application where I pass messages between different modules using the standard SendMessage and PostMessage. This all works
When passing a string, I use the code:
copyDataStruct.dwData := 1;
copyDataStruct.cbData := 1 + Length(AString);
copyDataStruct.lpData := PChar(AString);
SendMessage(Application.Ma
inFormHand
le, WM_PLG_COPYDATA, ATarget, Integer(@copyDataStruct));
where WM_PLG_COPYDATA is a messaging constant private to my own application, which is received by a message function of the form
procedure WMCopyData(var Msg : TWMCopyData); message WM_PLG_COPYDATA;
This also works, although all of the examples I have seen (copying between applications) use the standard procedure WMCopyData(var Msg : TWMCopyData); message WM_COPYDATA;
My question is: is there any reason why I should stick to the standard WM_COPYDATA rather than a private constant? I have done a check for memory leaks, and everything seems OK
Answer : Windows messaging
No, you can use your own constant.
I do however recommend that you use the function RegisterWindowMessage() to obtain your constant.
Random Solutions
where in windows 7 pro enabing remote desktop connection to this computer?
mailto hyperlink with multiple links on multiple lines
Newby needs question answered around VMWare Networking
Call a stored procedure containing a CURSOR from a stored procedure
Need a simple test for SIlverlight 4 w/ JavaScript
I need a motherboard or video card with two analog capable outputs? Hard to find since DVI-I has been replaced by DVI-D on most. Any suggestions?
Unable to delete some items on Draft folder con Exchange 2007.
Getting a "postbacktrigger is not a known element" ASP.NET waring
SQL query help..to join or not to join
iphone 3gs email with exchange server