Get Message
-
hi how to get message from other window such as OnMessage in Mfc
Every new thing you learn,Gives you a new personality.
In a form? If so, maybe override WndProc(). Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
hi how to get message from other window such as OnMessage in Mfc
Every new thing you learn,Gives you a new personality.
-
in Mfc
#define WM_MESSAGE WM_USER+1000 ON_MESSAGE(WM_MESSAGE,Function)
but i don't know how to create in vc.netEvery new thing you learn,Gives you a new personality.
As Mark said, override WndProc() to react on specific messages. Here is a C# example:
protected override void WndProc(ref Message m) {
if (m.Msg==LPWIN_Constants.WM_HOTKEY) {
int lParam=(int)m.LParam;
if (lParam==0x00580003) Activate(); // CTRL+ALT+X
if (lParam==0x00410008) ArchiveWindow(); // WIN+A
}:)
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.
-
in Mfc
#define WM_MESSAGE WM_USER+1000 ON_MESSAGE(WM_MESSAGE,Function)
but i don't know how to create in vc.netEvery new thing you learn,Gives you a new personality.
There's also sample code in four languages in the Control.WndProc() documentation[^] Mark
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
hi how to get message from other window such as OnMessage in Mfc
Every new thing you learn,Gives you a new personality.
Using Events is also another option for notifying another window.