 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Thu Oct 18, 2007 12:46 am
Feature requests: A way of knowing if CMUD has focus from script + flashing icon |
Partly as a companion to the new %iconstate() function, it would be useful to know from a script whether CMUD has focus or not, and, if so, which window in CMUD has focus. Example:
#SHOW %windowfocus
Returns:
"None" or the name of the window that has focus. Child windows should probably be something like "MainWindowName|ChildWindowName". If focus is on something like the Package Editor or Mapper, it might be "MainWindowName|PackageEditor" and "MainWindowName|AutoMapper".
This would be useful if, for example, you want to only set %iconstate() when CMUD is in the background. Or if you want to use #BEEP or some other sound only when CMUD is in the background (to tell you to look at CMUD).
----------
Also, an addition to %iconstate maybe or some other function to enable you to set the CMUD task bar icon to flashing and/or inverted colour. Like many chat programs do.
 |
|
|
|
 |
Guinn Wizard
Joined: 03 Mar 2001 Posts: 1127 Location: London
|
Posted: Thu Oct 18, 2007 12:59 am |
Motion seconded
|
|
_________________ CMUD Pro, Windows Vista x64
Core2 Q6600, 4GB RAM, GeForce 8800GT
Because you need it for text... ;) |
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Thu Oct 18, 2007 1:12 am |
You can already do this with the normal COM API:
| Quote: |
property zMUDIsActive: WordBool; READONLY
Returns true if zMUD is the currently active Windows application. |
You access this via the %cmud variable, and the "zMUD" was removed, so the method is just called "IsActive". So, check %cmud.IsActive and see if that works. |
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Fri Oct 19, 2007 12:13 am |
#show %cmud.IsActive
Displays a modal window that says "No method/property name: IsActive. CMUD is frozen until you switch to another window, switch back and close the dialog. You can't close it otherwise. Hmm, now you can close it. It seems to have a mind of its own. Anyway, it doesn't work.
This does work though:
#show %cmud.CMUDIsActive
However, this is only a fraction of the functionality I asked about in my original post, and the COM API is not very easy for most CMUD users to understand or use (this particular property is fairly easy, but others...). |
|
|
|
 |
Zugg MASTER

Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Fri Oct 19, 2007 2:14 am |
Oh, yeah, I was looking in the Session object. So %session.IsActive should work. For the main application object, it's %cmud.cMUDIsActive actually. And I think it's case sensitive, so I'm not sure how "CMUDIsActive" worked when it shouldn't. There are also all sorts of other API routines for getting the ID and handle of the active window. You can also already use stuff like %curwin to get the name of the active window.
Honestly, I really don't want to duplicate all of the COM interface into zScript. IsActive might be useful, but once I start down that path, then everyone will just want the entire API converted, and that's a lot of work for little benefit. The COM stuff really isn't very hard at all once you get used to it, although I'd recommend the Lua interface since it's very similar but easier to use. Actually, my main gripe with the COM stuff is that COM is case sensitive, and I hate case sensitivity, but some people are used to that. |
|
|
|
 |
Seb Wizard
Joined: 14 Aug 2004 Posts: 1269
|
Posted: Fri Oct 19, 2007 9:05 am |
Well, I'll give it a go then. Also, how would it work from Lua? What's the equivalent command?
|
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|