Skip to content

Instantly share code, notes, and snippets.

@BGMcoder
Created June 19, 2015 15:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BGMcoder/7415972a861bf48beee3 to your computer and use it in GitHub Desktop.
Save BGMcoder/7415972a861bf48beee3 to your computer and use it in GitHub Desktop.
Example of how to use a Picture Control as a Button
;http://ahkscript.org/boards/viewtopic.php?p=48057#p48057
#SingleInstance, On
#NoEnv
SetBatchLines, -1
#include mousey.ahk ;mousey library - http://ahkscript.org/boards/viewtopic.php?f=6&t=8352&p=48052#p48052
toggle := 0
gui, add, picture, h32 vIconButton hwndIconButton gtoggleicon icon45, shell32.dll
mouseycursor := mousey_init(IconButton,"hand")
gui, show
return
toggleicon:
if(toggle){
guicontrol,,IconButton, *icon45 shell32.dll
toggle := 0
}else{
guicontrol,,IconButton, *icon28 shell32.dll
toggle := 1
}
return
guiclose:
mousey_close(mouseycursor)
exitapp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment