What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Question (newb) about some api

Question (newb) about some api
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: Question (newb) about some api
quote:
Originally posted by Plan-1130
code:
Interop.Call("User32", "SendMessageW", hWnd, 0x10, 0, 0);

actually SendMessageW will force the close command to be executed immidiately, for the mainwindow that might work, but using PostMessageW just puts the close command at the end of the line...
Use instead:
code:
Interop.Call("User32", "PostMessageW", hWnd, 0x10, 0, 0);
if you want to play it safe.
Nothing is forced in either of them. The only difference is that SendMessage will wait until the message is processed. Which is in almost all code, prefereable. PostMessage returns immediatly and this can lead to many bugs in your code as it is not sure if the message is processes in time and thus things after this code line will be executed immediatly which in many cases should wait until the window has been closed (eg: clearing up handles, closing files, etc).

Also, this is part of the reason that I ask for far more details of him as everything depends on what he exactly wants and what it will be used for.


(PS: FYI, messenger itself does also a sendmessage when sending WM_CLOSE)

This post was edited on 11-16-2006 at 02:43 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
11-16-2006 12:53 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Question (newb) about some api - by AITEE on 11-15-2006 at 01:40 AM
RE: Question (newb) about some api - by matty on 11-15-2006 at 01:57 AM
RE: Question (newb) about some api - by AITEE on 11-15-2006 at 03:58 AM
RE: Question (newb) about some api - by CookieRevised on 11-15-2006 at 04:34 AM
RE: Question (newb) about some api - by Plan-1130 on 11-15-2006 at 11:24 PM
RE: Question (newb) about some api - by CookieRevised on 11-16-2006 at 12:53 AM
RE: Question (newb) about some api - by Plan-1130 on 11-16-2006 at 06:32 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On