Welcome Guest.   Make a donation to an author on the site October 25, 2014, 06:55:18 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Learn about the DonationCoder.com microdonation system (DonationCredits).
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Done: AutoStart Program(s), if key is pressed or CapsLock On/Off with Parameter  (Read 11201 times)
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« on: March 11, 2008, 05:20:59 PM »

Hi @all.
Is it possible to make a enhanced version of Capster (http://www.bcheck.net/apps/#capster) with the following new features:
- start program with parameter
- possibility to use other conditions to start a program e.g. other Keystrokes/Keys

(Program can also be an AutoHotKey Script.)

thx, for help.
« Last Edit: March 16, 2008, 07:57:40 PM by apfel » Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: March 13, 2008, 12:34:55 AM »

this can done with AHK but i'm afraid that the usage of other keys is limited to toggle-state keys such as Capslock, Numlock, Scroll-Lock and Insert. also by using AHK, the script itself can be placed in the Startup folder much like Capster. i'll try this over the weekend. Wink

Logged

apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #2 on: March 13, 2008, 08:31:03 AM »

Woohoo! Nice, Thank you!
Never believed someone would pick this up.  smiley
It would be already great, if you can add the "autostart program with parameter" feature.
Logged
skrommel
Fastest code in the west
Developer
***
Posts: 882



View Profile WWW Give some DonationCredits to this forum member
« Reply #3 on: March 13, 2008, 07:32:08 PM »

 smiley ToggleRun runs programs on startup when Capslock,Numlock, Scrolllock or Insert is down, or up.

You can also use RunWait instead of Run to wait for a program to end before running the next in the group.

Edit the script and place it in your startup folder. It is written in AutoHotkey from www.autohotkey.com.

Skrommel

[copy or print]
;ToogleRun.ahk
; Run programs on startup when Capslock, Numlock, Scrolllock or Insert is down
; Usage: Place the script in your startup folder
; Format: Run, Target [, WorkingDir, Max|Min|Hide ]
;Skrommel @ 2008

If (GetKeyState("Capslock","T")=1)
{
  Run,Notepad.exe C:\Test1.txt
  Run,Paint.exe C:\Test2.bmp
  Run,Write.exe C:\Test3.wri
}
Else
{
  Run,Calc.exe,,Min
  Run,IExplore.exe,,Max
}
If (GetKeyState("Numlock","T")=1)
  Run,Calc.exe,,Min
If (GetKeyState("Scrolllock","T")=1)
  Run,Pbrush.exe C:\Windows\Bubbles.bmp,,Max
If (GetKeyState("Insert","T")=1)
  Run,Write.exe
« Last Edit: March 14, 2008, 12:22:40 PM by skrommel » Logged

Please stop by my site at  1 Hour Software by skrommel  for downloads and more info.
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #4 on: March 14, 2008, 09:36:22 AM »

ok, made some changes. the program now aware of both situations - On/Off and added a button for open the startup folder.

--o--
it looks like Skrommel beat me to this but do try my version as well. Wink i made the GUI so that it's easier to choose the programs.

Caps-Run: a Capster clone.


btw, the beta label just indicates that i haven't added the About box and leave some room for any future configurations..

* Caps-Run-beta.zip (430.2 KB - downloaded 419 times.)
« Last Edit: March 16, 2008, 08:35:56 AM by lanux128 » Logged

apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #5 on: March 14, 2008, 10:02:07 AM »

Both scripts are nice, but Caps-Run is better and closer to Capster!
Could you add another Box, which includes both cases ON and Off?
Now I can manage the startup of my pc for individual use.

Thank you for both of your work.
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: March 14, 2008, 10:25:58 AM »

you're welcome and sure, i can add another drop-down for the ON/OFF toggle.. smiley but just curious, if the caps is off then wouldn't it just be a normal shortcut?
Logged

apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #7 on: March 14, 2008, 10:48:12 AM »

It would be another condition, e.g I would like to run two diffrent groups of app's. First group only starts Caps=ON and second group only starts CAPS=Off.

Edit: Feature Suggestion:
-a list, which shows all these "special" links with the possibility to delete them.
-option for Startup Delay (>=0) for each program
« Last Edit: March 14, 2008, 10:46:34 PM by apfel » Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: March 16, 2008, 08:30:50 AM »

ok, i've made the program aware of both situations (On/Off) and also added a button to open the startup folder so that you can edit or delete the shortcuts. as for the other request, i'd like to suggest that you try Startup Delayer which is quite popular here among DC'ers.. Wink
Logged

mitzevo
Supporting Member
**
Posts: 460



Control is power

see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #9 on: March 16, 2008, 08:38:35 AM »

Hmm, I've always had the idea of my start up programs starting by a key held down or toggled on.. And here we go cheesy

So I can boot up my box, login to xp, and have caps/num/etc on or off, to get programs to start up? Like normal startup procedures?

Logged

The clock is running. Make the most of today. Time waits for no man. Yesterday is history. Tomorrow is a mystery. Today is a gift. That's why it is called the present.
apfel
Participant
*
Posts: 63


View Profile Give some DonationCredits to this forum member
« Reply #10 on: March 16, 2008, 07:56:39 PM »

@lanux128 Thank you for you work!  Thmbsup
Logged
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: March 16, 2008, 08:38:06 PM »

apfel: glad to be of help. Cool

mitzevo: basically you just extract the zip file then run the program to create shortcuts in the startup folder based on the criteria you have specified. that's about it. smiley
Logged

Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #12 on: September 04, 2009, 06:32:46 PM »

Is there any way to make Caps-Run:

1. Supply the launched application with a startup directory?

2. Start the application minimized or maximized?

I also found a problem with quotation mark parsing.  If the parameters supplied in the Caps-Run config dialog contain quotes, those quotes are misinterpreted.  For example, if this is used in the Parameters box:

[copy or print]
cmdwait 10000 execmd start "" calc.exe

The first quotation mark after start gets interpreted as the end of the parameters to be sent to the application.
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: September 05, 2009, 08:28:26 PM »

items 1 & 2 are included in this release but i'm not sure about the quote marks parsing. can you explain a bit and are those commands from nircmd?

Caps-Run 1.2



Edit: Fixed max/min commands and start-in folder

* Caps-Run-v12.zip (437.21 KB - downloaded 284 times.)
« Last Edit: September 06, 2009, 02:44:51 AM by lanux128 » Logged

Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #14 on: September 05, 2009, 11:29:54 PM »

First of all, thank you very much for giving this your attention.

It seems that minimized and maximized are reversed.  That is, if Maximized is selected in the Caps-Run interface when the shortcut is created, the shortcut is actually created with "minimized" set, and vice-versa.

But the real problem is that this only sets the shortcut's parameters, and it doesn't affect how the program being run by Caps-Run actually loads.  Caps-Run would have to signal internally for the application to start minimized or maximized.

The startup directory is a similar issue.  Setting it in the shortcut only passes it to Caps-Run, not to the actual program being run.

I'm not sure how hard this would be to do, and I apologize if it's too much to ask.  I also apologize for the misunderstanding.

I will elaborate on the quote issue soon.
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: September 06, 2009, 02:56:43 AM »

But the real problem is that this only sets the shortcut's parameters, and it doesn't affect how the program being run by Caps-Run actually loads.  Caps-Run would have to signal internally for the application to start minimized or maximized.

you're right, i had missed the internal signals for Capsrun to launch the way you wanted. sorry, it's been some time since i coded that script and i had uploaded a total mess it seems. embarassed anyway, try the updated version and let me know if you run into any more problems. The startup folder also should be working now.


as for the quote marks, i referred to the help file and followed their suggestion of adding an external quotes around the command and it works.

Quote
When running a program via Comspec (cmd.exe) -- perhaps because you need to redirect the program's input or output -- if the path or name of the executable contains spaces, the entire string should be enclosed in an outer pair of quotes. In the following example, the outer quotes are shown in red and all the inner quotes are shown in black:
Run %comspec% /c ""C:\My Utility.exe" "param 1" "second param" >"C:\My File.txt""

Logged

Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #16 on: September 06, 2009, 08:34:16 AM »

Thank you, but setting the shortcut to "Minimized" won't make the child of capsrun.exe run minimized.

Regarding quotes, when I use these settings in Caps-Run:

Program:
c:\program files\console\nircmd.exe

Parameters:
cmdwait 2000 execmd start "" calc.exe

This is the command line that actually runs:

[copy or print]
"c:\program files\console\nircmd.exe" cmdwait 2000 execmd start " calc.exe    

If I change the Parameters to:
"cmdwait 20000 execmd start "" calc.exe"

This runs:

[copy or print]
cmdwait 20000 execmd start  calc.exe

Don't worry about any of this though.  I can live with Caps-Run without driving you nuts over this.  I'm sorry.
« Last Edit: September 06, 2009, 08:37:40 AM by Scott » Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: September 06, 2009, 08:39:51 AM »

Thank you, but setting the shortcut to "Minimized" won't make the child of capsrun.exe run minimized.

Regarding quotes, when I use these settings in Caps-Run:

Program:
c:\program files\console\nircmd.exe

Parameters:
cmdwait 2000 execmd start "" calc.exe

This is the command line that actually runs:

[copy or print]
"c:\program files\console\nircmd.exe" cmdwait 2000 execmd start " calc.exe    

If I change the Parameters to:
"cmdwait 20000 execmd start "" calc.exe"

This runs:

[copy or print]
cmdwait 20000 execmd start  calc.exe

And:
cmdwait 20000 execmd "start "" calc.exe"

Results in:

[copy or print]
cmdwait 20000 execmd start  calc.exe    

Don't worry about any of this though.  I can live with Caps-Run without driving you nuts over this.  I'm sorry.
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: September 06, 2009, 05:34:03 PM »

Thank you, but setting the shortcut to "Minimized" won't make the child of capsrun.exe run minimized.

that's strange because it works here. can you post an example? that'll help to get into the bottom of things.


Regarding quotes, when I use these settings in Caps-Run:

Program:
c:\program files\console\nircmd.exe



And:
cmdwait 20000 execmd "start "" calc.exe"

Results in:

[copy or print]
cmdwait 20000 execmd start  calc.exe    

Don't worry about any of this though.  I can live with Caps-Run without driving you nuts over this.  I'm sorry.

there is no need to apologize. i'm learning as well from this. smiley from what i see, nircmd launches two commands, one is 'cmdwait' and the other is 'execmd'. my guess is that since execmd parameters (start "" calc.exe) have a space in between them, it's best to quote so that it becomes "start "" calc.exe" instead, leaving the internal quotes intact.

hmm.. i think it's best to check timestamp of the Caps-run files. there are two files: one is the GUI: Caps-Run.exe and the helper app: capsrun.exe. if timestamps do not match the screenshot then try clearing out the folder and extract Caps-Run.exe again.

Logged

Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: September 06, 2009, 06:05:57 PM »

Any program I run (via Caps-Run) with the shortcut properties set to Minimized fails to run that way...  Such as simply specifying calc.exe as the program.

As far as the quotes go, nothing I try makes it work, even following your exact example above with "start "" calc.exe".
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: September 06, 2009, 06:10:44 PM »

hmm.. did i upload the wrong file? undecided so how about the timestamps?
Logged

Scott
Resident Googler
Charter Member
***
Posts: 377


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #21 on: September 06, 2009, 07:04:50 PM »

Each time I've downloaded a new Caps-Run copy, I manually go in and clear out its directory before extracting it.  I just did so again and tried...  Setting a calc.exe shortcut to run minimized doesn't work.

Don't sweat it...
Logged

« Next Edit: Tomorrow at 12:13:47 AM by Scott »
lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #22 on: September 06, 2009, 11:58:35 PM »

this must be just of the those things that refuses to work. cheesy maybe i should make a screen-cast showing that it works here, what do you think?

anyway, if you're willing to try again, please download from this alternate link and let me know the results.

http://lanux128.dcmembers...m/misc/Caps-Run-v1205.zip

P.S. are you running this on WinXP or some other OS? because i have tested only on WinXP.
Logged

lanux128
Global Moderator
*****
Posts: 6,109



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #23 on: September 07, 2009, 12:16:43 AM »

the calculator is not a very good example because i think calc.exe doesn't recognise the 'Run mimimized' command. even a normal shortcut pointing to "C:\WINDOWS\system32\calc.exe" and set run minimized will always start in normal mode. that's what happens on my PC.

i'm going to do some googling to see if this is common behaviour.

edit: even this command - "cmd /k start /min calc.exe" in the run box starts the calculator in the normal window.
« Last Edit: September 07, 2009, 12:32:51 AM by lanux128 » Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.045s | Server load: 0.08 ]