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 

Gadgets with Ahk
Goto page 1, 2  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Asty



Joined: 14 Jul 2009
Posts: 5

PostPosted: Fri Mar 12, 2010 5:17 am    Post subject: Gadgets with Ahk Reply with quote

Well, a few weeks ago i was looking for a gadget who gives me my internal and external ip. I couldn't find it so i've made one.
Here is how it looks with others windows gadgets.



Code:
#notrayicon
#singleinstance force
;To autostart with windows (optional); RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Run, Gadget IP, %A_ScriptFullPath%

urlDownloadToFile,http://www.whatismyip.com/automation/n09230945.asp,C:\ip.tmp ; To get your external ip
FileReadLine,ExternalIP,C:\ip.tmp,1

Gui, Add, Text, x120 y0 w10 h10 gclose,  ; this is a black spot behind the close button in the picture
Gui, Add, Text, x108 y0 w10 h10 grefresh, 
Gui, Add, Picture, x0 y0 w130 h62 , %A_scriptdir%/ip3.png ; The background image.
Gui, Color, 000000
gui, font, s6.5 cFFFFFF, Gauutami
Gui, Add, Text, x46 y30 w80 h13 gLAN,  %A_IPAddress1%
Gui, Add, Text, x42 y45 w85 h13 gWAN,%ExternalIP%
Gui -Caption  +toolwindow ; "-caption" wont show the button bar
Gui, Show, x1750 y360 h62 w130, Lan/Wan IP
Return

GuiClose:
ExitApp

close:
ExitApp

Refresh:
Reload
Return

WAN:
clipboard = %ExternalIP% ; Clicking the ip will copy it.
Return

LAN:
clipboard = %A_IPAdress1%
Return

#d::
winminimizeall


Background IMG



Extra: Code for the other gadget. (unfinished)

Code:
#notrayicon
#singleinstance force
;RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Run, Gadget Subs, %A_ScriptFullPath%
Gui, Add, Text, x120 y0 w10 h10 gclose,
Gui, Add, Text, x108 y0 w10 h10 grefresh, 
Gui, Add, Picture, x0 y0 w130 h62 , %A_scriptdir%/subtitulos1.png
Gui, Color, 000000
gui, font, s6.5 c000000, Gauutami
Gui, Add, Edit, x12 y34 w40 h15 vserie1,
Gui, Add, Edit, x72 y34 w40 h15 vcapitulo,
Gui, Add, Button, x116 y30 w0 h0 gsend, >
Gui -Caption  +toolwindow
Gui, Show, x1750 y280 h62 w130, Subititulos
Return

send:
Gui, submit, nohide
StringReplace, Serie, Serie1,%A_Space%,-, All
Run, http://subtitulos.es/%serie%/%capitulo%
Return

close:
ExitApp

Refresh:
Reload
Return

#d::
winminimizeall

; ::tbbt::the big bang theory


Background IMG
Back to top
View user's profile Send private message
Opie



Joined: 02 Nov 2009
Posts: 101

PostPosted: Fri Mar 12, 2010 6:47 am    Post subject: Reply with quote

very nice... for the image, maybe look into embedding the PNG file: http://www.autohotkey.com/forum/viewtopic.php?t=14941&highlight=bmp+encoding

nice idea nonetheless
Back to top
View user's profile Send private message
trik



Joined: 15 Jul 2007
Posts: 1320

PostPosted: Fri Mar 12, 2010 7:34 am    Post subject: Reply with quote

Very nice, clean, etc. FYI, they are called widgets.
_________________
Religion is false. >_>
Back to top
View user's profile Send private message
Guest






PostPosted: Sat Mar 13, 2010 1:11 am    Post subject: Reply with quote

you can add this if u like it, to easy move ur gadgets

Gui, Add, Picture, x0 y0 w130 h62 gmove, %A_scriptdir%/ip3.png

Move:
PostMessage, 0xA1, 2,,, A
return
Back to top
gronne



Joined: 25 Feb 2009
Posts: 6

PostPosted: Sat Mar 13, 2010 1:20 am    Post subject: Reply with quote

Love it! Thank you for sharing.
Back to top
View user's profile Send private message
Asty



Joined: 14 Jul 2009
Posts: 5

PostPosted: Sun Mar 14, 2010 9:58 am    Post subject: Reply with quote

Anonymous wrote:
you can add this if u like it, to easy move ur gadgets

Gui, Add, Picture, x0 y0 w130 h62 gmove, %A_scriptdir%/ip3.png

Move:
PostMessage, 0xA1, 2,,, A
return


Thx!!
Back to top
View user's profile Send private message
SoggyDog



Joined: 02 May 2006
Posts: 783
Location: Greeley, CO

PostPosted: Mon Mar 15, 2010 5:02 pm    Post subject: Reply with quote

trik wrote:
Very nice, clean, etc. FYI, they are called widgets.

Umm... No... They are called Gadgets.

Wikipedia
_________________

SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
Guest






PostPosted: Mon Mar 15, 2010 5:53 pm    Post subject: Reply with quote

Actually they can be both or either.
Quote:
Microsoft Gadgets are lightweight single-purpose applications, or software widgets, that can sit on a Microsoft Windows user's computer desktop, or are hosted on a web page.
Please read your own wiki links.
Back to top
SoggyDog



Joined: 02 May 2006
Posts: 783
Location: Greeley, CO

PostPosted: Mon Mar 15, 2010 6:08 pm    Post subject: Reply with quote

Anonymous wrote:
Actually they can be both or either.
Quote:
Microsoft Gadgets are lightweight single-purpose applications, or software widgets, that can sit on a Microsoft Windows user's computer desktop, or are hosted on a web page.
Please read your own wiki links.


Perhaps you should read it a little closer yourself;
The first two words of the quote you provided say it all... "Microsoft Gadgets"

"Microsoft Gadgets" is the proper name for a specific set of widgets.

It's like telling someone that Microsoft's operating system is called "Operating System";
It's not... It's Windows.

So, yes, they are, in some form, widgets, but they are -CALLED- Gadgets.
_________________

SoggyDog
Dwarf Fortress:
"The most intriguing game I've ever played."
Back to top
View user's profile Send private message Send e-mail Visit poster's website MSN Messenger
bad_w0lf



Joined: 28 Mar 2010
Posts: 10

PostPosted: Tue Mar 30, 2010 11:21 pm    Post subject: Reply with quote

I think it would be more like calling a computer a computer or a laptop rather than an HP or a Dell or Toshiba.
_________________
(\__/)
(='.'=)
(")_(")
This is Bunny
Help Bunny by Copying and pasting Bunny into your web page to help him gain world domination.
Back to top
View user's profile Send private message
Tyrsius



Joined: 09 Jul 2009
Posts: 140

PostPosted: Wed Mar 31, 2010 2:04 am    Post subject: Reply with quote

Zarrok wrote:
I think it would be more like calling a computer a computer or a laptop rather than an HP or a Dell or Toshiba.


You aren't wrong, but trik had corrected the OP by saying (using your metaphor) that it wasn't called a Dell, it was called a computer.

The OP was not wrong in calling them gadgets.
Back to top
View user's profile Send private message
Morpheus



Joined: 31 Jul 2008
Posts: 273

PostPosted: Wed Mar 31, 2010 12:07 pm    Post subject: Reply with quote

Who cares?
Back to top
View user's profile Send private message
Guest






PostPosted: Wed Mar 31, 2010 2:07 pm    Post subject: Reply with quote

[url]xkcd.com/386/[/url]
Laughing
Back to top
Guest






PostPosted: Wed Mar 31, 2010 2:09 pm    Post subject: Reply with quote

Hmm. Doesn't work without "www." Subdomain.

www.xkcd.com/386/
Laughing
Back to top
guest2
Guest





PostPosted: Tue Aug 02, 2011 6:08 am    Post subject: want copy of IP gadget Reply with quote

Asty,
Do you have a .gadget file created for that IP (LAN and WAN) gadget? I like it very much and would like in installable file. Thx
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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