Skip to content
All gists
Back to GitHub
Sign in
Sign up
Sign in
Sign up
{{ message }}
Instantly share code, notes, and snippets.
BGMcoder
/
IconPictureButton.ahk
Created
Jun 19, 2015
Star
0
Fork
0
Star
Code
Revisions
1
Embed
What would you like to do?
Embed
Embed this gist in your website.
Share
Copy sharable link for this gist.
Clone via HTTPS
Clone with Git or checkout with SVN using the repository’s web address.
Learn more about clone URLs
Download ZIP
Example of how to use a Picture Control as a Button
Raw
IconPictureButton.ahk
;
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
You can’t perform that action at this time.
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.