AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Can't restrict DropDownList to selected option

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
over21



Joined: 09 Mar 2010
Posts: 5

PostPosted: Tue Mar 09, 2010 11:53 am    Post subject: Can't restrict DropDownList to selected option Reply with quote

I'm trying to make a GUI to access a site a specific key combination (either Alt+C, or Ctrl+Alt+C, or Ctrl+Shift+C). The problem is that all the combinations work, always; it doesn't matter which one I've selected.

Code:
Gui, Add, DropDownList, x1 y1 w170 Drop, Alt+C||Ctrl+Alt+C|Ctrl+Shift+C
Gui, Show, x485 y345 h58 w308, Charazay HotKey
Return

!c::
if (DropDownList = "Alt+C")
{
IfWinExist, Charazay Basketball Manager - Opera
   WinActivate
else
   Run http://www.charazay.com
return
}

^!c::
if (DropDownList = "Ctrl+Alt+C")
{
IfWinExist, Charazay Basketball Manager - Opera
   WinActivate
else
   Run http://www.charazay.com
return
}

^+c::
if (DropDownList = "Ctrl+Shift+C")
{
IfWinExist, Charazay Basketball Manager - Opera
   WinActivate
else
   Run http://www.charazay.com
return
}

GuiClose:
  ExitApp
return


Help!
Back to top
View user's profile Send private message
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Tue Mar 09, 2010 1:16 pm    Post subject: Reply with quote

Code:
!c::
if (DropDownList = "Alt+C")
{
IfWinExist, Charazay Basketball Manager - Opera
   WinActivate
else
   Run http://www.charazay.com
return
}
return

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
over21



Joined: 09 Mar 2010
Posts: 5

PostPosted: Tue Mar 09, 2010 3:38 pm    Post subject: Reply with quote

I ended up doing the script a bit differently and I got it to work flawlessly. Those missing returns were part of the problem. Thanks man!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group