Click here to Skip to main content
15,886,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: java Pin
Aryan Gupta 202415-Mar-24 10:10
Aryan Gupta 202415-Mar-24 10:10 
GeneralRe: java Pin
CPallini16-Mar-24 1:44
mveCPallini16-Mar-24 1:44 
QuestionMy Visual Studio windows are all misplaced. Pin
Maximilien13-Mar-24 3:11
Maximilien13-Mar-24 3:11 
AnswerRe: My Visual Studio windows are all misplaced. Pin
Richard Andrew x6413-Mar-24 12:34
professionalRichard Andrew x6413-Mar-24 12:34 
GeneralRe: My Visual Studio windows are all misplaced. Pin
Maximilien14-Mar-24 2:44
Maximilien14-Mar-24 2:44 
GeneralRe: My Visual Studio windows are all misplaced. Pin
Richard Andrew x6414-Mar-24 2:52
professionalRichard Andrew x6414-Mar-24 2:52 
GeneralRe: My Visual Studio windows are all misplaced. Pin
RedDk16-Mar-24 11:21
RedDk16-Mar-24 11:21 
QuestionSendNotifyMessage() "queues" messages Pin
MikeBz12-Mar-24 5:53
MikeBz12-Mar-24 5:53 
This is an observation rather than a question - if it's not appropriate I will happily delete it.

I was wondering what would happen if multiple calls were made to SentNotifyMessage() (where the receiving window is owned by a different thread) during the period that the receiving thread was still processing the first such message it received. My guess as that the thread would be deemed hung and that SendNotifyMessage() would fail. Wrong!

The documentation says "...If the window was created by a different thread, SendNotifyMessage passes the message to the window procedure and returns immediately; it does not wait for the window procedure to finish processing the message."

Saying that it "passes the message" I think makes it clear that the message doesn't go into the same queue as messages posted with PostMessage().

I set up an experiment (on Windows 10) where the thread which owns the window 'hangs' itself (simply by sitting in a tight loop waiting for a period time to expire) for a substantial period of time when it first receives a message. The thread which sends the messages sits in a loop continuously sending a large number of messages (using SendMessageNotify). Using TRACE output to monitor what was happening I could see that all of the calls to SendMessageNotify() succeeded and happened whilst the receiver was hung processing the the first message. When that hung period expired it then received all of the remaining sent messages in succession. This worked with 100,000 "queued" messages. I was surprised. Windows obviously queues these messages and can cope with a very large number of them.
AnswerRe: SendNotifyMessage() "queues" messages Pin
jschell12-Mar-24 14:55
jschell12-Mar-24 14:55 
GeneralRe: SendNotifyMessage() "queues" messages Pin
MikeBz18-Mar-24 0:26
MikeBz18-Mar-24 0:26 
QuestionDetermining reason for SendMessageTimeout() failure Pin
MikeBz12-Mar-24 0:37
MikeBz12-Mar-24 0:37 
SuggestionRe: Determining reason for SendMessageTimeout() failure Pin
Richard MacCutchan12-Mar-24 5:50
mveRichard MacCutchan12-Mar-24 5:50 
GeneralRe: Determining reason for SendMessageTimeout() failure Pin
MikeBz12-Mar-24 5:52
MikeBz12-Mar-24 5:52 
AnswerRe: Determining reason for SendMessageTimeout() failure Pin
jschell12-Mar-24 15:01
jschell12-Mar-24 15:01 
GeneralRe: Determining reason for SendMessageTimeout() failure Pin
MikeBz17-Mar-24 23:52
MikeBz17-Mar-24 23:52 
QuestionVS2022, I hate thee... not really but I do wish Microsoft would stop f'ing around with menus and process... - MDI app, ON_NOTIFY Pin
charlieg3-Mar-24 15:42
charlieg3-Mar-24 15:42 
QuestionRe: VS2022, I hate thee... not really but I do wish Microsoft would stop f'ing around with menus and process... - MDI app, ON_NOTIFY Pin
CPallini3-Mar-24 21:01
mveCPallini3-Mar-24 21:01 
AnswerRe: VS2022, I hate thee... not really but I do wish Microsoft would stop f'ing around with menus and process... - MDI app, ON_NOTIFY Pin
charlieg4-Mar-24 1:24
charlieg4-Mar-24 1:24 
QuestionC code "crashes"... Pin
Salvatore Terress3-Mar-24 7:08
Salvatore Terress3-Mar-24 7:08 
AnswerRe: C code "crashes"... Pin
Victor Nijegorodov3-Mar-24 8:05
Victor Nijegorodov3-Mar-24 8:05 
AnswerRe: C code "crashes"... Pin
k50543-Mar-24 10:35
mvek50543-Mar-24 10:35 
GeneralRe: C code "crashes"... Pin
Salvatore Terress3-Mar-24 14:13
Salvatore Terress3-Mar-24 14:13 
GeneralRe: C code "crashes"... Pin
k50544-Mar-24 0:51
mvek50544-Mar-24 0:51 
GeneralRe: C code "crashes"... Pin
Salvatore Terress4-Mar-24 2:12
Salvatore Terress4-Mar-24 2:12 
Questionme vs. VS2022.. detecting NULL pointers Pin
charlieg29-Feb-24 11:38
charlieg29-Feb-24 11:38 

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.