Discussion of Inner Space
Moderators: Lavish Software Team, Moderators
-
zwjohn
- GamingTools Subscriber
- Posts: 16
- Joined: Mon May 29, 2006 10:05 am
Post
by zwjohn » Fri Sep 01, 2006 9:39 pm
Hi Lax,
I have multiple instances of WoW running on one machine, sometime I need to bring one of wow windows to foreground, so in my script I have windowvisibility foreground, however, it does not work all the time, half of the time when the command is used, the window doesnt come to foreground as expected, however it flashes at the windows bottom taskbar. I was wondering if these is any gurantted way to bring the window to front when I wanted.
Thanks !

-
Lax
- Owner
- Posts: 6634
- Joined: Fri Jun 18, 2004 6:08 pm
Post
by Lax » Sat Sep 02, 2006 10:48 am
http://msdn.microsoft.com/library/defau ... window.asp
Windows 98/Me: The system restricts which processes can set the foreground window. A process can set the foreground window only if one of the following conditions is true:
* The process is the foreground process.
* The process was started by the foreground process.
* The process received the last input event.
* There is no foreground process.
* The foreground process is being debugged.
* The foreground is not locked (see LockSetForegroundWindow).
* The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo).
* Windows 2000/XP: No menus are active.
What you should actually try instead of using windowvisibility is the focus command in the uplink.
http://www.lavishsoft.com/wiki/index.ph ... Command%29
Ex: "uplink focus is1"
-
zwjohn
- GamingTools Subscriber
- Posts: 16
- Joined: Mon May 29, 2006 10:05 am
Post
by zwjohn » Sat Sep 02, 2006 11:13 am
Thanks Lax for the explanations. It seems that the command is not guranteed,but it is just an attempt.
I tried uplink focus, it can only focus when current focus is with one of IS sessions. If my focus is at other application then uplink is unable to transfer focus to game window.
However if I press Ctrl+Alt+1 at anytime it will swith focus to my game window no matter what application was at top, Ctrl+Alt+1 was global bound to my first IS session during startup. I was wondering if there is anyway to simulate hardward keyboard press. I tried Press and wowpress etc.., but none of them worked if it was executed at background, the same as mouse clicks.
Any advise on these?
Thanks again!

-
Lax
- Owner
- Posts: 6634
- Joined: Fri Jun 18, 2004 6:08 pm
Post
by Lax » Sat Sep 02, 2006 11:23 am
Ctrl+Alt+1 is registered as a global windows hotkey, and is allowed to bring the window to the front because the window it is assigned to then meets the "The process received the last input event." requirement. Press would not work for that because it is emulating at the application level -- it will ONLY press a key in that application, which is already well past the point of global windows hotkeys. wowpress doesn't even emulate pressing a key, that just executes the assigned action in WoW.
The only way to do that is going to be to emulate a global keyboard event, which then you run the risk of it bleeding to any given application, or failing if you're typing, and so on. I dont see this happening unless you change the behaviors of Windows listed on MSDN for this situation.
What you CAN do instead is windowvis alwaysontop
-
zwjohn
- GamingTools Subscriber
- Posts: 16
- Joined: Mon May 29, 2006 10:05 am
Post
by zwjohn » Sat Sep 02, 2006 12:25 pm
Thanks for the info Lax. alwayontop also does not give focus to the caller if there was another application active. I was expecting something in Lavishscript to handle global mouse or keyboard, but seems you didnt put in such functions due to some concerns.
Anyways, I will look for other alternative ways to solve my problem.
Thanks for your time.
