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, 1:37 pm
  • 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

Author Topic: Create Shortcut Icons for Keyboard Shortcuts  (Read 9414 times)

Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Create Shortcut Icons for Keyboard Shortcuts
« on: March 15, 2015, 06:41 AM »
Hi, is there a program that allows users to assign keyboard shortcuts and save those as icons on the desktop?
 
For example, pressing Alt + F4 shows the window that allows the user to shutdown, restart, etc. Now I would like this shortcut to be created as a icon on my desktop so when I click that icon, this same window should show up.
 
Thanks!

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,612
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #1 on: March 15, 2015, 08:13 AM »
That's quite easy, but a step-by-step guide with pictures is the easiest, I guess: http://www.wikihow.c...-Shortcut-in-Windows

It does sound a little bit backward though... :huh:

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #2 on: March 15, 2015, 09:17 AM »
If you actually want to send the key sequence as if you keyed it while the desktop was the active window(has the keyboard focus)  you could script in AHK to just send the keys.  To send Alt + F4 in AHK is
Send !{F4}

So an AHK program to set focus to desktop then send Alt + F4 might look like this

; SendAltF4.ahk
; make Desktop active then
; send the keys
Sendmode Input
WinActivate ahk_class Progman
Send,!{F4}

Then just follow the same procedure to create a shortcut for the script as in the tutorial linked by Ath.  Or you can programatically create them using AHK's FileCreateShortcut command to create the .lnk files on the desktop.

Note:  To use the mini-scripts without AHK installed on the machine you would compile them to exe.  They might make fun novelty programs.  :)


« Last Edit: March 15, 2015, 09:27 AM by MilesAhead »

Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #3 on: March 15, 2015, 09:58 AM »
Thanks MilesAhead! I will test this and let you know if this works.

Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #4 on: March 15, 2015, 10:27 AM »
Lovely! Works just how I need it.  :up: I have also compiled it to get a executable file. Now figuring out a way to change the icon from the default letter "H"  :-\

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #5 on: March 15, 2015, 10:28 AM »
Thanks MilesAhead! I will test this and let you know if this works.

Since I have Windows 8 I did the shutdown for my machine with custom icon.

Capture.PNG

It produces the dialog shown

Clipboard01.jpg

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #6 on: March 15, 2015, 10:31 AM »
Lovely! Works just how I need it.  :up: I have also compiled it to get a executable file. Now figuring out a way to change the icon from the default letter "H"  :-\

http://www.autohotke...r-those-who-compile/

After installing right click the script in Explorer and click Compile With Options.  You can set version info as well as set a custom icon.  I usually check the box "store settings in script" to avoid getting an .ini file with settings for each script.

Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #7 on: March 15, 2015, 10:49 AM »
If the icon is a shortcut icon, then right click -> properties has the option to change the icon. However, a standalone executable does not. Is there another simpler way to change the icon?

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #8 on: March 15, 2015, 11:42 AM »
If the icon is a shortcut icon, then right click -> properties has the option to change the icon. However, a standalone executable does not. Is there another simpler way to change the icon?

No you need to recompile using that ahkII.  Once it is installed right click on a file with ,ahk extension(your script source) and click Compile with Options. A tab there has a check box and browse button to include the icon as the program's icon as a resource in the exe.

Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #9 on: March 18, 2015, 11:50 PM »
I could not see the menu option "Compile with options" after right clicking the ahk script file. However, I managed to go to the program folder and run ahk2exe and select it there. Anyway, thanks a lot for your help on this...

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #10 on: March 19, 2015, 05:29 AM »
I could not see the menu option "Compile with options" after right clicking the ahk script file. However, I managed to go to the program folder and run ahk2exe and select it there. Anyway, thanks a lot for your help on this...

It is a user written utility.  Did you download it from the "for those who compile" link I posted?  It's very convenient especially if you wish to embed stuff like version number etc..

Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #11 on: March 19, 2015, 02:09 PM »
I used the official download link

http://ahkscript.org...load/ahk-install.exe


as the link you provided had dead link. :(

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #12 on: March 19, 2015, 03:36 PM »
I used the official download link

http://ahkscript.org...load/ahk-install.exe


as the link you provided had dead link. :(

The link you posted is the ahk installer.  The one I'm talking about is just a utility to put a Gui front end on the compiler for stuff like setting a custom icon etc..  The links for Compile_AHK II do give 404 errors.  I posted on the thread to find out if that is temporary or where they are hosting it now.. if anywhere.  It would be a shame to lose it as it is way convenient.

Here is the one I have until we can find out where to download



Nzyme

  • Participant
  • Joined in 2011
  • *
  • Posts: 100
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #13 on: March 23, 2015, 08:36 AM »
Ok thanks!

MilesAhead

  • Supporting Member
  • Joined in 2009
  • **
  • Posts: 7,736
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #14 on: March 28, 2015, 10:09 AM »
Here's a download page with source and setup for Compile AHK II

http://ge.tt/8zMaRUW1/v/7

cranioscopical

  • Friend of the Site
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 4,776
    • View Profile
    • Donate to Member
Re: Create Shortcut Icons for Keyboard Shortcuts
« Reply #15 on: March 28, 2015, 11:36 AM »
Miles, thanks for posting about this.
Did you find a way to point it at a '.bin' other than Temp\etc.? There's a field to change this but, here, any compile reverts to Temp\etc and shows an error.

's okay. Coss posting—while you were adding the newer link, I was posting my question. Works fine for me now.
« Last Edit: March 28, 2015, 11:44 AM by cranioscopical, Reason: asked and answered »