ShowWindow does not work in Windows 7 |
Author: |
Message: |
RicardO.sys
New Member
RicardO.sys
Posts: 6
33 / /
Joined: Aug 2008
|
O.P. ShowWindow does not work in Windows 7
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?
|
|
12-18-2011 12:14 AM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: ShowWindow does not work in Windows 7
What error are you getting in the debugger because it works here without a problem.
|
|
12-19-2011 01:07 AM |
|
|
RicardO.sys
New Member
RicardO.sys
Posts: 6
33 / /
Joined: Aug 2008
|
O.P. RE: ShowWindow does not work in Windows 7
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 ?
|
|
12-19-2011 02:48 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: ShowWindow does not work in Windows 7
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]
|
|
12-19-2011 03:12 PM |
|
|
RicardO.sys
New Member
RicardO.sys
Posts: 6
33 / /
Joined: Aug 2008
|
O.P. RE: ShowWindow does not work in Windows 7
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
|
|
12-19-2011 03:31 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: ShowWindow does not work in Windows 7
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);
}
|
|
12-19-2011 03:36 PM |
|
|
RicardO.sys
New Member
RicardO.sys
Posts: 6
33 / /
Joined: Aug 2008
|
O.P. RE: RE: ShowWindow does not work in Windows 7
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
|
|
12-19-2011 03:46 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: ShowWindow does not work in Windows 7
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.
|
|
12-19-2011 03:48 PM |
|
|
RicardO.sys
New Member
RicardO.sys
Posts: 6
33 / /
Joined: Aug 2008
|
O.P. RE: ShowWindow does not work in Windows 7
Thank you friend, changing value the variable GA_PARENT to 2, it worked \o/
|
|
12-19-2011 03:59 PM |
|
|
matty
Scripting Guru
Posts: 8336 Reputation: 109
39 / /
Joined: Dec 2002
Status: Away
|
RE: ShowWindow does not work in Windows 7
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.
|
|
12-19-2011 04:03 PM |
|
|
Pages: (2):
« First
[ 1 ]
2
»
Last »
|
|