What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [Thx] DestroyWindow on chatwindow = crash?

[Thx] DestroyWindow on chatwindow = crash?
Author: Message:
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. [Thx] DestroyWindow on chatwindow = crash?
All in title :P

This post was edited on 03-25-2007 at 12:39 AM by Flash.
My script: Psdp
03-23-2007 11:39 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: DestroyWindow on chatwindow = crash?
Don't use DestroyWindow anyways, it doesn't give a chance for the window to clean up. Instead, you have quite a few options:

[list=1][*]Send "/close" to the chat window (not recommended because it shows up in the recent messages list and won't work if commands are disabled)
[*]Send a WM_COMMAND message with the menu identifier of the Close menu item
[*]Send a WM_CLOSE message
[*]Call CloseWindow on the chat window - this doesn't close it, nevermind[/list]

The WM_CLOSE method is probably the best to use :)

This post was edited on 03-24-2007 at 05:55 PM by deAd.
03-24-2007 12:12 AM
Profile PM Find Quote Report
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. RE: DestroyWindow on chatwindow = crash?
1- Pluswnd.Sendmessage work with chatwnd?
2- what the value of WM_close?

This post was edited on 03-24-2007 at 05:30 PM by Flash.
My script: Psdp
03-24-2007 05:29 PM
Profile PM Find Quote Report
deAd
Scripting Contest Winner
*****

Avatar

Posts: 1060
Reputation: 28
– / Male / Flag
Joined: Jan 2006
RE: DestroyWindow on chatwindow = crash?
Here's code to do each way (I'm bored :P). I recommend you use the last one ;)

[list=1][*]Send "/close" to the chat window (not recommended because it shows up in the recent messages list and won't work if commands are disabled)
code:
pChatWnd.SendMessage('/close');
[*]Send a WM_COMMAND message with the menu identifier of the Close menu item
code:
Interop.Call('User32.dll', 'SendMessageW', pChatWnd.Handle, 0x111 /* WM_COMMAND */, 40017, 0);
[*]Send a WM_CLOSE message
code:
Interop.Call('User32.dll', 'SendMessageW', pChatWnd.Handle, 0x0010 /* WM_CLOSE */, 0, 0);
[/list]
03-24-2007 05:54 PM
Profile PM Find Quote Report
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. RE: DestroyWindow on chatwindow = crash?
aaaaaah thx its the W i missed SendMessageW lol and thx for the value
My script: Psdp
03-24-2007 06:21 PM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: DestroyWindow on chatwindow = crash?
quote:
Originally posted by Flash26
aaaaaah thx its the W i missed SendMessageW lol and thx for the value
The W stands for "Wide".

Many APIs come in two versions, and ascii version and a wide version. This is for when you send text (or rather a handle to a text string in memory), since text can either be pure ascii or unicode (=wide characters =characters which are build from more than 1 byte... eg: Japanees, Hebrew, etc)

For sending a close command or close message it doesn't matter what you use since those commands and/or messages are numeric. So you could also use: "SendMessageA".

Such info like this can easly be found in the MSDN library

;)

This post was edited on 03-24-2007 at 11:50 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-24-2007 11:49 PM
Profile PM Find Quote Report
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. RE: [Thx] DestroyWindow on chatwindow = crash?
ok thx, but i can use all time W?
My script: Psdp
03-25-2007 12:41 AM
Profile PM Find Quote Report
CookieRevised
Elite Member
*****

Avatar

Posts: 15519
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: [Thx] DestroyWindow on chatwindow = crash?
quote:
Originally posted by Flash26
ok thx, but i can use all time W?

Yes, you can use the 'wide' version all the time with numeric messages or commands which do not return strings or which don't have anything todo with strings (eg: thus not commands or messages which return the amount of bytes in a string either).

No, you can't use the 'wide' version if you are going to pass a handle to an ascii string as a parameter or if the function will return a handle to an ascii string (which can also be the result of a numeric send message).

This post was edited on 03-25-2007 at 01:15 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
03-25-2007 12:47 AM
Profile PM Find Quote Report
Flash
Junior Member
**

Avatar
All time Ready

Posts: 86
Reputation: 2
44 / Male / Flag
Joined: Aug 2006
O.P. RE: [Thx] DestroyWindow on chatwindow = crash?
ok master :P
cookie u can help me for this
http://shoutbox.menthix.net/showthread.php?tid=72970

This post was edited on 03-25-2007 at 12:50 AM by Flash.
My script: Psdp
03-25-2007 12:49 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


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