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

C / C++ / MFC

 
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 
GeneralRe: PreTranslateMessage Pin
Paul M Watt1-Mar-02 10:12
mentorPaul M Watt1-Mar-02 10:12 
Your code segment would work, and yes you could change the message a little, not send it forward at all, or even change the message itself to something entirely different. The main issue is making sure that people who may want to use your class or control in the future understand the behavior.

I should also say, that it is not very wise to send your own WM_PAINT messages, if this is how you intend on getting the user defined value in the lParam. Maybe create your own user defined paint message.

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

If you want to stop WM_PAINT message from being sent, you can simply call ValidateRect(hWnd, NULL). WM_PAINT messages are not really entered into the message queue, GetMessage or PeekMessage for that matter will send a WM_PAINT message directly to the target window only when there are no other posted messages left in the message queue.

If you call ValidateRect(hWnd, NULL) after you have performed the painting that you are interested in, then a WM_PAINT message will never be generated.
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 
GeneralRe: MSFlexGrid control in Console Application Pin
Nish Nishant1-Mar-02 20:56
sitebuilderNish Nishant1-Mar-02 20: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.