topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 6:48 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: DONE - IDEA: launch apps on Fast User Switch (set vol., etc).  (Read 45992 times)

JeffK

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 363
    • View Profile
    • Donate to Member
I thought of an idea.  My 16 year old daughter and I are continually coming to blows about our joint use of the computer.  Quite apart from her forgetfulness about who pays for it and is therefore entitled to use it as he sees fit, she is always complaing because I mute the sound.

She goes on, turns her music on up loud, and leaves it on loud when she's finished.  I get on and straight away I either turn the speakers down or mute it in some other way.  Whaen she returns she whinges about having to turn the sound up again.  I swear the next time she does it the speakers a re going in the trash.

What would be nice would be a preset speaker volume for each user (we have Win XP Home SP2).  When the computer is being used under my name the volume level returns to a default (for me that would be zero) and when she switches to her account it swithches to her default (set by me so that the neighbours don't complain).

Probably harder than it sounds to program.  What do you guru's think?

Jeff (cross posted from another place in the forum).
« Last Edit: May 01, 2005, 06:41 PM by mouser »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Coding for volume setting application
« Reply #1 on: April 27, 2005, 09:42 PM »
i know this could be done by using a commandline volume setting tool and creating two shortcuts, each executed when the different person logs in, so this probably is not something to be coded as an app, but rather someone who knows how to do this and knows a good commandline volume setter (i know these exist) could maybe post a howto..


Scott

  • Resident Googler
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 378
    • View Profile
    • Read more about this member.
    • Donate to Member
volume control stuff
« Reply #2 on: April 27, 2005, 09:50 PM »
There are a bunch of utils that can easily control (or completely mute) the volume.  One of them is the command line utility NirCmd.

I use NirCmd for exactly this purpose already.  Whenever I boot, the following command line runs, to make sure I didn't accidentally leave the volume too high before shutting down:

nircmd.exe setsysvolume 16384

To do it on a per-user basis, you'd run a similar command in each user's startup group (as a shortcut), or under the applicable HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run registry key.  This won't work if you're using Fast User Switching on WinXP, though, and using it to switch between user accounts.
« Next Edit: Tomorrow at 12:13:47 AM by Scott »

JeffK

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 363
    • View Profile
    • Donate to Member
Re: Coding for volume setting application
« Reply #3 on: April 27, 2005, 10:10 PM »
That would be good.

frogblast

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
Re: IDEA: Coding for volume setting application
« Reply #4 on: April 30, 2005, 05:11 AM »
The problem is a commandline solution won't help when using Fast User Switching to switch between accounts that are already open. (I don't know if that's your usage pattern....)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Coding for volume setting application
« Reply #5 on: April 30, 2005, 05:32 AM »
so there is no tool that lets you specify programs to run when a fast user switch takes place? that would seem very useful tool..

JeffK

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 363
    • View Profile
    • Donate to Member
Re: IDEA: Coding for volume setting application
« Reply #6 on: April 30, 2005, 05:34 AM »
That nircmd suggestion above does solve part of the problem.  When either me or my daughter logon for the first time the volume could be set accordingly.  It's only when we FUS that it would still be a problem - that would only be about 25% of the time.

Jeff

frogblast

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
Re: IDEA: Coding for volume setting application
« Reply #7 on: April 30, 2005, 09:47 AM »
so there is no tool that lets you specify programs to run when a fast user switch takes place? that would seem very useful tool..

Yes, I agree. :) Personally, I would use it in combination with the command line tool devcon.exe to turn my little son's mouse on when switching to his account, and off when switching to mine. If his mouse is enabled at the same time as mine, it tends to make the mouse pointer drift....
« Last Edit: April 30, 2005, 09:51 AM by frogblast »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: IDEA: Coding for volume setting application
« Reply #8 on: April 30, 2005, 10:13 AM »
if no such tool exists that lets you run commands on a fast-user switch, then this would seem an excellent and simple tool.
please people help search for such a tool, and if one cannot be found, we will write.

JeffK

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 363
    • View Profile
    • Donate to Member
Thank you mouser and fellow forum members.

Jeff

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
it was suggested that windows 2k/xp have policy settings built in where you can specify applications to launch at login; i tested these and they do not work for fast user switching, so such a tool is still nesc.

would probably be quite easy to make a tray tool that checked user name periodically and called apps on change, but would be nicer to have a more sophisticated solution..

dtrud0h

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 55
    • View Profile
    • Rant-Zone
    • Donate to Member
How about a small executable that would first set the volume level, then perform a FUS?

I'm no coder but....

code code setvolume to......win+l named switch to DAD.exe

instead of using win+l or however you do it
<- I have nothing witty to put here ->

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
thats a clever workaround..

however db is experimenting with a more general tool to let you execute commands triggered by a switch, so stay tuned.

JeffK

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 363
    • View Profile
    • Donate to Member
Both the above posts raised my hope level!!  :up:

frogblast

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
Maybe the guy who wrote this: http://perso.wanadoo...rDisplaySettings.htm could help with some information on how to monitor for fast user switches.

dmiranda

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
db (see coder post) has written a first version of a tool to do this, but its a little buggy, so it may take just a little bit to get it working smoothly.  but he's made a very nice implementation that lets you set up an ini file of apps to run for each user when they are switched to.

frogblasts post was useful as that author seemed to encounter some of the same issues.

db90h

  • Coding Snacks Author
  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 481
  • Software Engineer
    • View Profile
    • Bitsum - Take control of your PC
    • Read more about this member.
    • Donate to Member
Hi all,

Release soon.

J
« Last Edit: May 01, 2005, 01:57 PM by db90h »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
i've been helping db test his app for a while now - there are some tricky things he has had to figure out.
and i'm happy to say it's working perfectly now for me.
he might still have to do a tweak to make sure it runs with proper permissions,
and setting up the files in the write places with the right names requires a little bit of work,
but i'll be damned if the damn thing doesn't work like a charm :)

it lets you specify an ini file for each user, with a list of apps to run including commandline parameters.  these are executed every time user is switched to, and at startup (first login).  very neat.  you could use it to set resolution like XPKeepPerUserDisplaySettings does too (to set to a fixed setting), using a commandline resolution changer, or a variety of things.

i'll wait for db to put up the final version before i add it to the coding snacks download page,
and maybe jeffk would be kind enough, once you get it working, to write a little more lengthy tutorial of how you set it up to work with volume control, just as a real-life example of how you set it up, that db could include as a readme, to help new users? would you be willing to do that jeff?

JeffK

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 363
    • View Profile
    • Donate to Member
Yes certainly.  I might struggle a little time wise as my wife is away visiting her mother in hospital for some days.  And boy is the house a mess.

Thanks, db and mouser, for the effort you put into this app.  I'm sure it will have application beyond my sound issue.

Regards,

Jeff

dtrud0h

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 55
    • View Profile
    • Rant-Zone
    • Donate to Member
 ;)

outstanding   
     

This site is amazing,  Well Done.

Three cheers for DonationCoder.com

Pip Pip.........

HOORAY...HOORAY...HOORAY
[/size]
<- I have nothing witty to put here ->

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE - IDEA: launch apps on Fast User Switch (set vol., etc).
« Reply #21 on: May 01, 2005, 07:07 PM »
hehehe, cool... didn't even know that feature was there.

Seriously though, i want to thank all of you who participated in this experiment with the new idea of Coding Snacks.
We didn't know if it would be a completely flop, or if anyone would show up and make requests.

I think for a first attempt, it went pretty well.  Hopefully we can attract some more user and more coders over time and continue to improve it.  But I had fun and I hope you guys had fun too, which was really the whole point.  And I was surprised at the fact that this section also proved to be a useful way to find out about existing tools I never heard of.

I think this experience has been good enough that we are going to go ahead and make Coding Snacks a regular feature of the site; people can post requests at any time, and coders can visit for snacks, and then on the last weekend of each month we'll have a special marathon like we did this weekend.

ps.
thank's especially to db and the other guest coders who dropped by to help out.


frogblast

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
Re: DONE - IDEA: launch apps on Fast User Switch (set vol., etc).
« Reply #22 on: May 02, 2005, 07:17 PM »
Excellent! I can't wait to check it out.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: DONE - IDEA: launch apps on Fast User Switch (set vol., etc).
« Reply #23 on: May 02, 2005, 07:50 PM »
it's been up since yesterday, on coding snacks download page.
expect to experiment a little to get the files in the right places - i had to make a separate copies for my dif users so that file permissions were correct. and create shortcuts in start menu to the runonswitch exe.

frogblast

  • Participant
  • Joined in 2005
  • *
  • default avatar
  • Posts: 14
    • View Profile
    • Donate to Member
Re: DONE - IDEA: launch apps on Fast User Switch (set vol., etc).
« Reply #24 on: May 04, 2005, 07:44 AM »
db, thanks for coding this little gem. I'd like to report on a problem I seem to be having, however.

I have RunOnSwitch enabled for two accounts (call them A and B). A.ini looks like this:
Exec0=E:\WINDOWS\devcon.exe
Args0=disable "USB\Vid_04b4&Pid_0001"
and B.ini looks like this:
Exec0=E:\WINDOWS\devcon.exe
Args0=enable "USB\Vid_04b4&Pid_0001"
The ini for A is supposed to disable one of the mice attached to my system, while the ini for B is supposed to enable it.

The problem is that RunOnSwitch seems to get it backwards. When I switch from A to B, the mouse is disabled, and when I switch from B to A, it is enabled. I might understand the problem if the command line were a toggle, but it's not. I'm puzzled.