Re: How do I do this on Win...

Jeffery Priddy
SubjectRe: How do I do this on Windows?
FromJeffery Priddy
Date04/29/2004 04:07 (04/29/2004 02:07)

In, Sandman <>wrote:

In article <c6e5k7$tq1$>, Jeffery Priddy <>wrote:

Jeffery Priddy
Let's see.

The current song thing: I'm not sure about WMP; I use Winamp. If I were rolling my own, I'd use tlist (like ps) to get Winamp's title bar text, which would include the current song. Just parse out the playlist number and the Winamp title. It wouldn't surprise me if there were little applets or plugins to export this info from Winmap or WMP, but I haven't looked.

Prompting yourself for what you're currently doing would be easy. It's not hard to ask Windows what task currently has focus, so you could automate a variation of that, naming the app you currently have forward.

As for logon status, I have a freebie from sysinternals called psloggedon which shows who's logged on locally and who's accessing files or pipes through the network. There are a lot of other ways to do this, but this is what I would use.

The idle time: Well, I had an elaborate scheme cooked up to do this, based on the Task Scheduler, and it's ability to start any task after x minutes of idle time (usefull, eh?). But then my curiosity got the best of me, and I peeked thru Google to see if I could find anything better. I found a COM object for use with WSH that returns idle time straight up, so all my machinations seemed overly complicated. I could describe it, if you were curious, but now I'd just use this add-on.

Finally, someone answered your question... :-)

Yes, finally! :)

Thanks a lot. "tlist" is built in, right? It wouldn't be able to do things like fetch genr? and stuff like that, right? The other utilities were addons, correct?

The particular tool tlist, one of many tools for enumerating processes, is not built-in, but is (was?) free from Microsoft. XP has something built- in, which is similar, called "tasklist"-- I haven't used it much; I got in the habit of using tlist from pre-W2k days. This method would not fetch genr?, just the file name, which in my case would be title and artist. If I wanted other stuff like genr?, I could get the current file name from a process list, and extract the tag info from the file. I believe this could be coded from scratch in WSH, but there are probably add-ons to make it easier. I guess it would also depend on the formats you play; I'm thinking primarily of mp3s.

The other tools are add-ons, which I use out of habit. I believe everything described could be done with built-in WSH alone, except the idle time, and I could be wrong about that. If you wanted to challenge yourself to do idle time without outside tools, I'm sure you could do it with WSH and the Task Scheduler in combination.