Click here to Skip to main content
15,905,136 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WM_USER+1 vs RegisterWindowsMessage Pin
alex.barylski1-Mar-02 12:02
alex.barylski1-Mar-02 12:02 
GeneralRe: WM_USER+1 vs RegisterWindowsMessage Pin
Tomasz Sowinski1-Mar-02 12:16
Tomasz Sowinski1-Mar-02 12:16 
GeneralRe: WM_USER+1 vs RegisterWindowsMessage Pin
alex.barylski1-Mar-02 12:21
alex.barylski1-Mar-02 12:21 
GeneralRe: WM_USER+1 vs RegisterWindowsMessage Pin
Tim Smith1-Mar-02 12:51
Tim Smith1-Mar-02 12:51 
GeneralRe: WM_USER+1 vs RegisterWindowsMessage Pin
Michael Dunn1-Mar-02 12:21
sitebuilderMichael Dunn1-Mar-02 12:21 
GeneralRe: WM_USER+1 vs RegisterWindowsMessage Pin
alex.barylski1-Mar-02 14:17
alex.barylski1-Mar-02 14:17 
QuestionBrief & Epsilon emulation in VisStudio.Net? Pin
1-Mar-02 11:10
suss1-Mar-02 11:10 
GeneralPreTranslateMessage Pin
alex.barylski1-Mar-02 9:34
alex.barylski1-Mar-02 9:34 
I'm little blurry about the purpose of PreTranslateMessage so can someone clear it up for me if i'm wrong.

This function allows you to basically emulate the message pump of an SDK program...?

while(GetMessage(&msg, NULL, 0, 0))
{
  TranslateMessage(&msg);
  DispatchMessage(&msg);
}


is basically:

CMyView::PreTranslateMessage(MSG* pMsg)
{
  //You can use this function to dispatch messages to the 
  //proper window or ignore them them altogather
  //Is the following possible
  if(pMsg->message == WM_PAINT)
  {
    if(pMsg->lParam == 1000) //User-defined message
      //Change the message struct attribs a little
    else
      //Ignore the message altogather
  }
}  


Do I call DispatchMessage directly from with the PreTranslateMessage() or do I call the default CView::PreTranslateMessage()

Can I change the message a little before sending it off to WndProc...?

Basically in the above code i'm trying to accomplish the following:

1) WM_PAINT message received THEN
2) Check lParam for user-defined value
3) if lParam==VALUE THEN
Change DC to another DC
else
Prevent message from getting to WndProc.

I think WM_PAINT actually can't be stopped until BeginPaint is called, which will remove it from the queue.

I hope I was clear on the effect I am after and I hope even more that someone understands me and can offer suggestions or advice.

Thanx!

"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
GeneralRe: PreTranslateMessage Pin
Paul M Watt1-Mar-02 10:12
mentorPaul M Watt1-Mar-02 10:12 
GeneralRe: PreTranslateMessage Pin
alex.barylski1-Mar-02 10:36
alex.barylski1-Mar-02 10:36 
GeneralRe: PreTranslateMessage Pin
alex.barylski1-Mar-02 10:45
alex.barylski1-Mar-02 10:45 
GeneralWinsock API Pin
jangel1-Mar-02 8:19
jangel1-Mar-02 8:19 
GeneralRe: Winsock API Pin
Nish Nishant1-Mar-02 13:00
sitebuilderNish Nishant1-Mar-02 13:00 
QuestionAre the STL classes thread-safe? Pin
Le centriste1-Mar-02 8:05
Le centriste1-Mar-02 8:05 
AnswerRe: Are the STL classes thread-safe? Pin
Nemanja Trifunovic1-Mar-02 8:04
Nemanja Trifunovic1-Mar-02 8:04 
GeneralCListCtrl question Pin
jafrazee1-Mar-02 7:56
jafrazee1-Mar-02 7:56 
GeneralRe: CListCtrl question Pin
Shog91-Mar-02 7:59
sitebuilderShog91-Mar-02 7:59 
GeneralRe: Icon Searcher v1.2 and over 30,000 icons download Pin
Jon Hulatt1-Mar-02 7:07
Jon Hulatt1-Mar-02 7:07 
GeneralRe: Icon Searcher v1.2 and over 30,000 icons download Pin
Nish Nishant1-Mar-02 7:28
sitebuilderNish Nishant1-Mar-02 7:28 
GeneralRe: Icon Searcher v1.2 and over 30,000 icons download Pin
alex.barylski1-Mar-02 8:30
alex.barylski1-Mar-02 8:30 
GeneralMSFlexGrid control in Console Application Pin
Don Miguel1-Mar-02 6:29
Don Miguel1-Mar-02 6:29 
GeneralRe: MSFlexGrid control in Console Application Pin
Nish Nishant1-Mar-02 6:29
sitebuilderNish Nishant1-Mar-02 6:29 
GeneralRe: MSFlexGrid control in Console Application Pin
Bill Wilson1-Mar-02 8:46
Bill Wilson1-Mar-02 8:46 
GeneralRe: MSFlexGrid control in Console Application Pin
Carlos Antollini1-Mar-02 9:12
Carlos Antollini1-Mar-02 9:12 
GeneralRe: MSFlexGrid control in Console Application Pin
Don Miguel1-Mar-02 20:46
Don Miguel1-Mar-02 20:46 

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.