[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  General
. . -> [Subject]  Bringing the MUSHclient window to the front of the desktop.

Bringing the MUSHclient window to the front of the desktop.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by MushclientNewbie   USA  (33 posts)  [Biography] bio
Date Wed 24 Mar 2004 06:53 AM (UTC)
Message
When I mud, I generally have other windows open and browse throughout them during some sleeping ticks and whatnot. Along with that - I have a cd in the player or something else using the audio channel. So, this is my question:

Is there some way to bring the MUSH window to the front?

For example, my character is asleep and I alt+tab to the MUSH forums :). I don't know that someone came in and woke me up as soon as I tabbed, though, and they're ripping my poor character into bits.

So, basically, it could operate off of a "You stand and wake up." trigger.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #1 on Wed 24 Mar 2004 10:48 AM (UTC)
Message
Why not just make a sound? :P
OK, here is the code:

set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "MUSHclient - ["
set WshShell = Nothing

That will bring MUSHclient to front.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #2 on Wed 24 Mar 2004 10:16 PM (UTC)
Message
Gee.. MS strikes again. I just went looking to see if there was a WindowActivate command someplace in scripting too, since using GetFrame would tend to be more reliable, but there wasn't. I personally don't trust things that use the title bar contents to manipulate a window. If you have more than one of any application open, but don't know the *exact* text to use, then it opens the first one it finds, which isn't always the right window. Oh well, it was worth a look, even if it proved as pointless as usual.
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Thu 25 Mar 2004 04:00 AM (UTC)
Message
I think this will be easy to add as a script function. It is the same functionality that you get when clicking on the MUSHclient icon in the tray.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #4 on Thu 25 Mar 2004 04:39 AM (UTC)

Amended on Thu 25 Mar 2004 04:43 AM (UTC) by Shadowfyr

Message
Should be easy as a function. It is basically nothing more than a 'SetActiveWindow(whndl);' API call in user32.dll, which is itself nothing more than the same thing you pass to the GetFrame command.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #5 on Thu 25 Mar 2004 10:02 AM (UTC)
Message
Actually,

AppActivate Method

Activates an application window.

object.AppActivate title 
Arguments
object 
WshShell object. 
title 
Specifies which application to activate. This can be a string containing the title of the application (as it appears in the title bar) or the application's Process ID. 

How you retrieve the Process ID, though, is another matter :p

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Shadowfyr   USA  (1,786 posts)  [Biography] bio
Date Reply #6 on Thu 25 Mar 2004 06:02 PM (UTC)
Message
Yes. SetActiveWindow and AppActivate are entirely different. The first can activate any window, even child windows of an application, if they are loaded. The other one is specific to applications, but imho as useful as employing the title is, it is also unreliable, since you could concievably have 50 windows open that all have the same title.
[Go to top] top

Posted by MushclientNewbie   USA  (33 posts)  [Biography] bio
Date Reply #7 on Thu 25 Mar 2004 07:33 PM (UTC)

Amended on Thu 25 Mar 2004 07:36 PM (UTC) by MushclientNewbie

Message
Re: Poromenos - Why not sound?
Like I said, the audio channel is in use :).

Of course I could just turn media player off and use a triggered sound to tell me when to tab, but what fun would that be? In any case, you fellas are way ahead of me in programming department. I know enough to get around with VB, but it's a trial for me to say the least.

Re: Nick Gammon
When you say 'add as a script function' do you mean like in an update of MUSHclient? Or, something I can do on my end?
[Go to top] top

Posted by Nick Gammon   Australia  (22,973 posts)  [Biography] bio   Forum Administrator
Date Reply #8 on Thu 25 Mar 2004 08:43 PM (UTC)
Message
I will add a script function into the next version where you can just do:

ActivateClient

That can be in a trigger that gets "sent to script" - that should make the window come to the front.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by MushclientNewbie   USA  (33 posts)  [Biography] bio
Date Reply #9 on Thu 25 Mar 2004 08:53 PM (UTC)
Message
Yay! I helped devlop a new feature! Well... not so much as devlop, but you know.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #10 on Thu 25 Mar 2004 10:15 PM (UTC)
Message
The code I gave you should work until the new feature is released... Oh, and, get a new soundcard :P It must be really really old if it doesn't support playing 2 sounds at once :)

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by MushclientNewbie   USA  (33 posts)  [Biography] bio
Date Reply #11 on Fri 26 Mar 2004 01:17 AM (UTC)
Message
Re: Poromenos
Not old, just low-tech onboard ^^.
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


24,533 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]