Shoutbox

ShowWindow does not work in Windows 7 - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Thread: ShowWindow does not work in Windows 7 (/showthread.php?tid=98732)

ShowWindow does not work in Windows 7 by RicardO.sys on 12-18-2011 at 12:14 AM

I have a script that works perfectly in Windows XP, but does not work in Windows 7.
Here's the problem with the code.

code:
Interop.Call("User32.dll", "ShowWindow", ChatWnd.Handle, 0);

I'm using the event

code:
OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)

what should I do to make this function working again?
RE: ShowWindow does not work in Windows 7 by matty on 12-19-2011 at 01:07 AM

What error are you getting in the debugger because it works here without a problem.


RE: ShowWindow does not work in Windows 7 by RicardO.sys on 12-19-2011 at 02:48 PM

does not appear any error in the debugger ...
can it be for some of the system security policy ?
or also something about the conversations are in tab instead of separate windows ?


RE: ShowWindow does not work in Windows 7 by matty on 12-19-2011 at 03:12 PM

Post the full code and let me have a look at it.

ShowWindow does work in Windows 7 and there isn't a security policy that will affect the function of an API.

When you post the code use the following tags:
[code=js][/code]


RE: ShowWindow does not work in Windows 7 by RicardO.sys on 12-19-2011 at 03:31 PM

Javascript code:
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind)
{
  Interop.Call("User32.dll", "ShowWindow", ChatWnd.Handle, 0);
}


I've tried a few variations and nothing.
the window gets to hang for a few 10s, but after this time it unlocks and not some.

* sorry the english, is the google translator rsrsrs
RE: ShowWindow does not work in Windows 7 by matty on 12-19-2011 at 03:36 PM

Try something along these lines since you are using tabbed chats.

Javascript code:
var SW_HIDE = 0;
var GA_PARENT = 1;
 
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
    Interop.Call('user32', 'ShowWindow', Interop.Call('user32', 'GetAncestor', ChatWnd.Handle, GA_PARENT), SW_HIDE);
}


RE: RE: ShowWindow does not work in Windows 7 by RicardO.sys on 12-19-2011 at 03:46 PM

quote:
Originally posted by matty
Try something along these lines since you are using tabbed chats.

Javascript code:
var SW_HIDE = 0;
var GA_PARENT = 1;
 
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
    Interop.Call('user32', 'ShowWindow', Interop.Call('user32', 'GetAncestor', ChatWnd.Handle, GA_PARENT), SW_HIDE);
}



the window is stuck and will not display anything, it's just the mold and does not disappear
RE: ShowWindow does not work in Windows 7 by matty on 12-19-2011 at 03:48 PM

quote:
Originally posted by RicardO.sys
quote:
Originally posted by matty
Try something along these lines since you are using tabbed chats.

Javascript code:
var SW_HIDE = 0;
var GA_PARENT = 1;
 
function OnEvent_ChatWndReceiveMessage(ChatWnd, Origin, Message, MsgKind) {
    Interop.Call('user32', 'ShowWindow', Interop.Call('user32', 'GetAncestor', ChatWnd.Handle, GA_PARENT), SW_HIDE);
}



the window is stuck and will not display anything, it's just the mold and does not disappear
Ok then it is a limitation of tabbed chats. However... you could try and mimic the menu press to undock the window and then hide it. That is really your only option in this scenario I do believe.
RE: ShowWindow does not work in Windows 7 by RicardO.sys on 12-19-2011 at 03:59 PM

Thank you friend, changing value the variable GA_PARENT to 2, it worked \o/


RE: ShowWindow does not work in Windows 7 by matty on 12-19-2011 at 04:03 PM

quote:
Originally posted by RicardO.sys
Thank you friend, changing value the variable GA_PARENT to 2, it worked \o/
Ok that is great.

The different values GetAncestor accepts can be located here: http://msdn.microsoft.com/en-us/library/windows/d...3502(v=vs.85).aspx.

The reason you were having a problem is because in a tabbed chat grouping the ChatWindow has a different parent.
RE: ShowWindow does not work in Windows 7 by RicardO.sys on 12-19-2011 at 04:18 PM

thanks for the help and explanation (=
but I was intrigued, even if I disable the grouping of windows in tabs, the first code I posted here, did not work. =S


RE: ShowWindow does not work in Windows 7 by matty on 12-19-2011 at 04:20 PM

quote:
Originally posted by RicardO.sys
thanks for the help and explanation (=
but I was intrigued, even if I disable the grouping of windows in tabs, the first code I posted here, did not work. =S
Unless they changed the way the windows are created it should have worked...