Re: SendMessage Returns a Value?
- Posted by "Derek Parnell" <ddparnell at bigpond.com> Mar 23, 2004
- 458 views
----- Original Message ----- From: "C. K. Lester" <euphoric at cklester.com> To: <EUforum at topica.com> Subject: Re: SendMessage Returns a Value? > > > Derek Parnell wrote: > > >Because this is sendiong a message to many windows running in other > >applications, the range of possible errors is too large to be represented by a > >single return value. So there is no return value. Either the other windows will > >be the message or not. Maybe you should us PostMessageA instead, as this always > >returns a true/false and does not wait for all windows to be notified before > >returning to your application. > > > > > What does this statement mean: "Applications that need to communicate > using HWND_BROADCAST should use the RegisterWindowMessage > > <http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/Windowing/MessagesandMessageQueues/MessagesandMessageQueuesReference/MessagesandMessageQueuesFunctions/RegisterWindowMessage.asp> > > function to obtain a unique message for inter-application communication." > > Does that apply to what I'm trying to do (which is just install a font > and then HWND_BROADCAST a WM_FONTCHANGE message, for holy's sake). No. The WM_FONTCHANGE message is a predefined one that all apps should know about. Its talking about 'normal' app-to-app communications. If one has two applications that need to send messages to each other, the RegisterWindowMessage is needed to create a unique message number in the system for those apps to pass. Not required for font changes. -- Derek