AutoHotkey Community

It is currently May 27th, 2012, 4:46 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Hotkey Activation help
PostPosted: March 10th, 2010, 1:45 pm 
Hi all-
Cannot get script to run with hotkey enabled. How do you make a hotkey
available at all times while a script is running?

My code below. At anytime I want the user to be able to hit the F12, input a message and have it displayed in the text box of the GUI.

Jim

#SingleInstance force
F12::Goto, DailyMessage
return

Gui, Add, Button, x5 y5 w100 h20 , Calculator
Gui, Add, Button, x5 y25 w100 h20 , Notepad
gui, font, s12 , Verdana
Gui, Add, Text , x5y70 w300 h15 +0x800000, %DailyNotice%
Gui, Show, x140 y110 h80 w330, CS Dashboard
Return

ButtonNotepad:
Gui, submit
Run, Notepad.exe, C:\My Documents, max
return

ButtonCalculator:
Gui, submit
Run, calc.exe, C:\My Documents, max
return

DailyMessage:
InputBox, DailyNotice, Daily Notice, Please enter your message, , 300, 100
return

GuiClose:
ExitApp


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 2:12 pm 
Offline

Joined: May 12th, 2009, 2:37 pm
Posts: 640
Location: Gloucester UK
Try putting the Hotkey at the bottom of the script.

Currently the script is running up to the return after the hotkey and then not running any more.

Pop the hotkey at the end then the Gui will run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 2:31 pm 
... and please use code tags around you code, it makes it much easier to read.

Code:
#SingleInstance force
F12::Goto, DailyMessage
return

Gui, Add, Button, x5 y5 w100 h20 , Calculator
Gui, Add, Button, x5 y25 w100 h20 , Notepad
gui, font, s12 , Verdana
Gui, Add, Text , x5y70 w300 h15 +0x800000, %DailyNotice%
Gui, Show, x140 y110 h80 w330, CS Dashboard
Return

F12::Goto, DailyMessage ; put almost anywhere... after the end of the auto-execute section
return


ButtonNotepad:
Gui, submit
Run, Notepad.exe, C:\My Documents, max
return

ButtonCalculator:
Gui, submit
Run, calc.exe, C:\My Documents, max
return

DailyMessage:
InputBox, DailyNotice, Daily Notice, Please enter your message, , 300, 100
return

GuiClose:
ExitApp
... see how much nicer that looks?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 10th, 2010, 2:36 pm 
damn... how did I screw that up? :oops:

Code:
#SingleInstance force

Gui, Add, Button, x5 y5 w100 h20 , Calculator
Gui, Add, Button, x5 y25 w100 h20 , Notepad
gui, font, s12 , Verdana
Gui, Add, Text , x5y70 w300 h15 +0x800000, %DailyNotice%
Gui, Show, x140 y110 h80 w330, CS Dashboard
Return

F12::Goto, DailyMessage ; put almost anywhere... after the end of the auto-execute section
return


ButtonNotepad:
Gui, submit
Run, Notepad.exe, C:\My Documents, max
return

ButtonCalculator:
Gui, submit
Run, calc.exe, C:\My Documents, max
return

DailyMessage:
InputBox, DailyNotice, Daily Notice, Please enter your message, , 300, 100
return

GuiClose:
ExitApp


Report this post
Top
  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO and 60 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group