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 

network connection monitering in Autohotkey GUI?

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



Joined: 11 Feb 2009
Posts: 142
Location: India

PostPosted: Wed Feb 11, 2009 1:49 pm    Post subject: network connection monitering in Autohotkey GUI? Reply with quote

Friends,

I'm working on this project
making a autohotkey GUI taskbar just like windows taskbar with starmenu and clock and everything.

but I'm stuck at network connection icon.
as you know that When we get connected to internet, there is a network connection icon in the taskbar near the clock. which gives functionality
to view how much data transffered, + enable / disable the connection.

How can I add that thing in my autohotkey GUI?

Thanks in Advance
Back to top
View user's profile Send private message
Sivvy



Joined: 21 Jul 2008
Posts: 726
Location: Calgary, AB, Canada

PostPosted: Wed Feb 11, 2009 4:25 pm    Post subject: Reply with quote

Ownership.

Here are a few lines of code from an incomplete script I stopped writing that steals the Windows TaskBar and places it onto my own GUI (Among other things, but all you really need is the TaskBar part).

Code:
ControlGet FauxTaskBar, Hwnd, , ToolbarWindow322, ahk_class Shell_TrayWnd  ; TaskBar
FauxTaskBarParent := GetParent(FauxTaskBar)  ; Parent of TaskBar

TaskBarLength := A_ScreenWidth - 80
BarHeight = 30
y := A_ScreenHeight - BarHeight

Gui -Caption +ToolWindow +AlwaysOnTop +0x02000000 ; WS_CLIPCHILDREN
Gui Show, W%TaskBarLength% H%BarHeight% x80 y%y%, NewTaskBar

StartButtonPos := y - 30
StartButtonHeight := BarHeight + 55
Gui 2:-Caption +ToolWindow

Gui 2:Show, w1000 h%StartButtonHeight% x0 y%StartButtonPos%, StartButtonGui
WinSet Region, 0-0 w82 h82 E, StartButtonGui
WinSet Transparent, 100, StartButtonGui

FauxGuiWindow := WinExist("NewTaskBar")
GoSub, AddTools
Return

ShowStartMenu: ; Show real startmenu using my own button.
    SendMessage 0x112, 0xF130 ;  WM_SYSCOMMAND = 0x112 SC_TASKLIST = 0xF130
Return

AddTools:
    SetParent(FauxTaskBar, FauxGuiWindow) ; Steal ownership
    ControlMove, , 5, , , , ahk_id %FauxTaskBar%
    WinHide, ahk_class Shell_TrayWnd ; Hide real TaskBar
Return

RestoreTools:
    SetParent(FauxTaskBar, FauxTaskBarParent) ; Reset the owner
Return

GetParent(FauxControl) ; Get current control owner.
{
    Return DllCall("GetParent", "UInt", FauxControl)
}

SetParent(FauxControl, FauxNewParent) ; For changing control ownership.
{
    Return DllCall("SetParent", "UInt", FauxControl, "UInt", FauxNewParent)
}

^r::
RestoreExit:
    GoSub RestoreTools
    WinShow ahk_class Shell_TrayWnd ; Show real TaskBar
ExitApp

OnMessage(0x7E, "WM_DISPLAYCHANGE") ; In case user changes screen resolution
    Return
   
WM_DISPLAYCHANGE() ; In case user changes screen resolution
{
    Reload
}


Not sure if that helps you any, but it shouldn't be too hard to figure out how to get Tray items.

Edit: If you put a picture in "Gui 2", clicking on it will act like clicking the start button.

To end the script and return ownership to Windows... Press "CTRL+r".
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