Re: Sending a UserRegistered Message from a dll to the main applicaition
From: Christopher J. Holland (msnews_at_microsoft.com)
Date: 07/15/04
- Next message: Philipp Huber: "database access"
- Previous message: TVR Fan: "Re: Registry Keys"
- In reply to: Anders Eriksson: "Sending a UserRegistered Message from a dll to the main applicaition"
- Next in thread: Joseph M. Newcomer: "Re: Sending a UserRegistered Message from a dll to the main applicaition"
- Reply: Joseph M. Newcomer: "Re: Sending a UserRegistered Message from a dll to the main applicaition"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 15 Jul 2004 01:59:03 -0700
I am no expert in this area, just interested...
I did a bit of reading and from what I understand, he should be using
HWND_BROADCAST.
The purpose of using RegisterWindowMessage(), is not really knowing the
application that receives the message.
Although, the dll could ask for the handle and post the message using the
handle as well.
By using HWND_BROADCAST;
"The message is posted to all top-level windows in the system,
including disabled or invisible unowned windows, overlapped windows,
and pop-up windows. The message is not posted to child windows."
That would mean the message will only go to the applications Top Level
window
and not some dialog underneath, he would have to handle the message at the
top level,
then dispatch the message further down to the Dialog.
main.exe (could be a dialog based app?)
Something else that I am thinking about, is that when you load a dll, I am
thinking it is just like saying
"new code"
So, if in his example he was to post a message, my thinking is that it would
only go
to the window/thread in which the DLL was called, whatever that may be.
If that is not true, where does the message actually go?
Is my thinking correct?
Thanks,
-- Christopher J. Holland [!MVP] http://www.mvps.org/vcfaq/ http://www.codeguru.com http://www.codeproject.com http://www.naughter.com/ http://support.microsoft.com/default.aspx http://msdn.microsoft.com/howto/ http://msdn.microsoft.com/library/ http://www3.pgh.net/~newcomer "Anders Eriksson" <anders.eriksson@morateknikutveckling.se> wrote in message news:w6krysaxxfa5.dlg@morateknikutveckling.se... > Hello! > > I have an MFC 7.1 application that uses a dll. The dll is not MFC it's a > SDK DLL. > > Both the application and the dll is compiled as UNICODE. > > I want to send a user registered message from the .dll to the main .exe > > I have used > static const UINT UWM_OUTPORT_MSG = > ::RegisterWindowMessage(_T("UWM_OUTPORT_{737386A0-62B1-4701-A9D5-436A8C07B83 F}")); > > In both the .dll and the .exe > > and in the dll i do: > > PostMessage(NULL,UWM_OUTPORT_MSG,0,0); > > and in the main app I have: > > BEGIN_MESSAGE_MAP(CIOOutputDlg, CTabPageSSL) > ON_REGISTERED_MESSAGE(UWM_OUTPORT_MSG, OnOutPortMsg) > END_MESSAGE_MAP() > > LRESULT CIOOutputDlg::OnOutPortMsg(WPARAM, LPARAM) > { > // do something > } > > The OnOutPortMsg method will never be called!! > > Please help! > > // Anders
- Next message: Philipp Huber: "database access"
- Previous message: TVR Fan: "Re: Registry Keys"
- In reply to: Anders Eriksson: "Sending a UserRegistered Message from a dll to the main applicaition"
- Next in thread: Joseph M. Newcomer: "Re: Sending a UserRegistered Message from a dll to the main applicaition"
- Reply: Joseph M. Newcomer: "Re: Sending a UserRegistered Message from a dll to the main applicaition"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|