Click here to Skip to main content
15,902,114 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Making an Edit multiline? Pin
steven117-Jul-04 6:06
steven117-Jul-04 6:06 
GeneralDifference between thread and fiber on windows Pin
haritadala7-Jul-04 1:46
haritadala7-Jul-04 1:46 
GeneralRe: Difference between thread and fiber on windows Pin
David Crow7-Jul-04 2:35
David Crow7-Jul-04 2:35 
QuestionHow to Detect Invalid Filenames Pin
Steve Thresher7-Jul-04 1:37
Steve Thresher7-Jul-04 1:37 
AnswerRe: How to Detect Invalid Filenames Pin
V.7-Jul-04 1:44
professionalV.7-Jul-04 1:44 
AnswerRe: How to Detect Invalid Filenames Pin
PengFeidu7-Jul-04 2:17
PengFeidu7-Jul-04 2:17 
Generali Have two Question Pls Some one reply Pin
ThatsAlok6-Jul-04 23:55
ThatsAlok6-Jul-04 23:55 
GeneralRe: i Have two Question Pls Some one reply Pin
Abhi Lahare7-Jul-04 0:34
Abhi Lahare7-Jul-04 0:34 
Alok the programmer wrote:
Question #2: i am unable to use or rather say understand RegisterWindowMessage() api's.Any body pls gice me some pointer towrad it also.

Here is some explaination from one of expert:

The RegisterWindowMessage function defines a new window message
that is guaranteed to be unique throughout the system.

So with that in minde this is one example of how to use this
special message.

If I have this code in one of my applications:
<br />
LRESULT CALLBACK MyWindowProc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)<br />
{<br />
  LRESULT Result;<br />
<br />
  static UINT my_message = RegisterWindowMessage("my_message");<br />
<br />
  if (msg == my_message)<br />
  {<br />
    MessageBox(hwnd, "Someone sent me my_message", "Message", MB_OK);<br />
    return 0;<br />
  }<br />
<br />
  ....<br />
<br />
  return Result;<br />
}<br />


I could talk to that application from my second application
using the following code:

// Use FindWindow, EnumWindows and EnumChildWindows to get
// the hwnd of the other application
hwnd = getting_other_hwnd_left_as_excersise_function();

UINT my_message = RegisterWindowMessage("my_message");

//-- post the hwnd the special message
::PostMessage(hwnd, my_message, 0, 0);

You could also do this:

//-- broad cast a special message
::PostMessage(HWND_BROADCAST, my_message, 0, 0);

but in this case you would need to trap the message in the
second application using the following code instead:
  <br />
while (GetMessage(&msg, (HWND) NULL, 0, 0)) <br />
{<br />
  if (msg == my_message)<br />
  {<br />
    MessageBox(hwnd, "Someone sent me my_message", "Message", MB_OK);<br />
  }<br />
  else<br />
  {<br />
    TranslateMessage(&msg);<br />
    DispatchMessage(&msg);<br />
  }<br />
}<br />

Jussi Jumppanen
Author of: Zeus for Windows, Win32 (Brief, WordStar, Emacs) Text Editor
"The C/C++, Java, HTML, Pascal, Cobol, Fortran programmer's text editor"
Home Page: http://www.zeusedit.com
Hope this will help you.

Regards
Abhishake
GeneralRe: i Have two Question Pls Some one reply Pin
ThatsAlok7-Jul-04 2:34
ThatsAlok7-Jul-04 2:34 
GeneralRe: i Have two Question Pls Some one reply Pin
David Crow7-Jul-04 2:57
David Crow7-Jul-04 2:57 
GeneralRe: i Have two Question Pls Some one reply Pin
ThatsAlok7-Jul-04 4:29
ThatsAlok7-Jul-04 4:29 
GeneralRe: i Have two Question Pls Some one reply Pin
David Crow7-Jul-04 4:32
David Crow7-Jul-04 4:32 
GeneralRe: i Have two Question Pls Some one reply Pin
Abhi Lahare7-Jul-04 2:58
Abhi Lahare7-Jul-04 2:58 
GeneralRe: i Have two Question Pls Some one reply Pin
ThatsAlok7-Jul-04 4:37
ThatsAlok7-Jul-04 4:37 
Questionhow activex control is created? Pin
Abhi Lahare6-Jul-04 23:43
Abhi Lahare6-Jul-04 23:43 
QuestionHow to Write Installer Pin
Zeeshan Bilal6-Jul-04 23:37
Zeeshan Bilal6-Jul-04 23:37 
Questionhow can i forcely Minimize the Dailog Pin
Zeeshan Bilal6-Jul-04 21:38
Zeeshan Bilal6-Jul-04 21:38 
AnswerRe: how can i forcely Minimize the Dailog Pin
V.6-Jul-04 21:50
professionalV.6-Jul-04 21:50 
QuestionHow to develop this ISAPI? Pin
wood6-Jul-04 21:14
wood6-Jul-04 21:14 
GeneralMessagebox Pin
Anonymous6-Jul-04 20:59
Anonymous6-Jul-04 20:59 
GeneralRe: Messagebox Pin
A T I F6-Jul-04 21:08
A T I F6-Jul-04 21:08 
GeneralRe: Messagebox Pin
Liger_Zero_X6-Jul-04 21:16
Liger_Zero_X6-Jul-04 21:16 
GeneralRe: Messagebox Pin
Anonymous6-Jul-04 21:36
Anonymous6-Jul-04 21:36 
GeneralRe: Messagebox Pin
Jose Cezar S. Ynion6-Jul-04 22:52
Jose Cezar S. Ynion6-Jul-04 22:52 
GeneralRe: Messagebox Pin
Jose Cezar S. Ynion6-Jul-04 22:56
Jose Cezar S. Ynion6-Jul-04 22:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.