I created a fun gui. Named it X-Gui. The X stands for "Experimental" :lol:. Just in the tradtition of the X planes.
This is how it looks like at the moment. The GUI is twice as big as the image displays. I just shrinked the image so that it doesn't get too big in filesize.
Download the zip file containing all images and the script below. Installation is easy. Simply extract the zip file to a folder of your choice and run XGui.ahk
:arrow: X-GUI.zip
In case you wonder. The gui doesn't do anything. It serves no purpose at the moment. Thanks to corrupt, who did quite an awesome job on the code, most of the bugs, which where listed here before, were corrected. That's why I updated the zip file above and the the scriptcode below.
Attention:
I think the GUI won't work under an OS < 2k (e.g. W98') due to using WinSet, TransColor.
Perhaps One Thing:
Adding a text control is obviously a problem. Either the background gets transparent or you have to GuiControl -Background it. But then it gets an ugly grey on my system. How do you assign a custom backgroundcolor with GuiControl?
Feel free to post any strange behaviours.
Some minor bugfix:
24.12.2005
+major code changes thx to corrupt - see thread. (thx corrupt or as I will call him "Mr WinMessage" )
20.12.2005
+Added shimanovs proposed corrections. (thx shimanov)
+Fixed final Gui, 2:Show - Gui should work now under resolution 1024*768 too
Here is the new script with lots of corrupt code :
#NoTrayIcon DetectHiddenWindows On SetBatchLines -1 ScriptName = X-Gui win1Width := 250 winstep := 100 Gui1XPos := 505 CustomColor = 0000FF SliderStatus = 0 ; ##### Left Slider ########################################################## Gui, 1:Margin, 0, 0 Gui, 1:Color, %CustomColor% Gui, 1:Add, Picture, vGuiFade gGuiFade x8 ym+120 w20 h20, %A_ScriptDir%\images\ico_1.bmp Gui, 1:Add, Picture, xp-5 ym, %A_ScriptDir%\images\slider.bmp Gui, 1:Add, Picture, x8 ym+120 w20 h20, %A_ScriptDir%\images\ico_1.bmp Gui, 1:Add, Edit, x120 y20 w100 Gui, 1:Add, Button, xp+110 yp+3 h16 w16 Gui, 1:Add, GroupBox, x120 yp+20 h30 w126 Gui, 1:Add, Checkbox, xp+8 yp+12 w13 h13 Gui, 1:Add, Checkbox, xp+48 yp w13 h13 Gui, 1:Add, Checkbox, xp+48 yp w13 h13 Gui, 1:Add, Text, x120 yp+24, This is a Test GUI. Gui, 1:Show, w%win1Width% x%Gui1XPos% Hide, %ScriptName% WinSet, TransColor, %CustomColor% 255, %Scriptname% Gui, 1:-Caption GuiControl, -BackgroundFFFFFF, Static4 ; ##### Right Menu ########################################################### Gui, 2:+Owner1 Gui, 2:Margin, 0, 0 Gui, 2:Color, %CustomColor% Gui, 2:Add, Picture, xm ym, %A_ScriptDir%\images\menu.bmp Gui, 2:Add, Picture, gGuiMinimize x73 y30, %A_ScriptDir%\images\ico_2.bmp Gui, 2:Add, Picture, gGuiClose x73 y55, %A_ScriptDir%\images\ico_3.bmp Gui, 2:Show, Hide, RightMenu WinSet, TransColor, %CustomColor% 255, RightMenu Gui, 2:-Caption ; ##### Green AHK Button ##################################################### Gui, 3:+Owner2 Gui, 3:Margin, 0, 0 Gui, 3:Color, %CustomColor% Gui, 3:Add, Picture,, %A_ScriptDir%\images\button.bmp Gui, 3:Show, x535 Hide, AHKButton WinSet, TransColor, %CustomColor% 255, AHKButton Gui, 3:-Caption ; ##### Finally show all gui ################################################# Gui, 1:Show, w%win1Width% x%Gui1XPos%, %ScriptName% Gui, 2:Show, x783, RightMenu Gui, 3:Show, x535, AHKButton win1hwnd := WinExist(ScriptName) win2hwnd := WinExist("RightMenu") win3hwnd := WinExist("AHKButton") OnMessage(0x46, "WM_WINDOWPOSCHANGING") OnMessage(0x47, "WM_WINDOWPOSCHANGED") OnMessage(0x201, "WM_LBUTTONDOWN") OnMessage(0x202, "WM_LBUTTONUP") Return GuiClose: ExitApp GuiMinimize: Gui, 1:Show, Hide WinMinimize, ahk_ID %win1hwnd% Return GuiFade: If (!Slstat AND !slactive) { slactive := True WinGetPos, win1XPos,,win1XWid1,, ahk_ID %win1hwnd% WinGetPos, win3XPos,,,, ahk_ID %win3hwnd% win1widthRem := win1width - (win1width / winstep) Loop, % (win1width / winstep) { WinMove, ahk_ID %win1hwnd%, , (win1XPos - (A_Index * winstep)), , (win1XWid1 + (A_Index * winstep)) } If win1widthRem WinMove, ahk_ID %win1hwnd%, , win1XPos - win1widthRem, , (win1XWid1 + win1widthRem) Slstat := True slactive= } Else If (Slstat AND !slactive) { WinGetPos, win3XPos,,,, ahk_ID %win3hwnd% WinSet, Transparent, 0, ahk_ID %win1hwnd% WinMove, ahk_ID %win1hwnd%,, (win3XPos - 30),, (200) WinSet, TransColor, %CustomColor%, ahk_ID %win1hwnd% slactive= slstat= } Return Movewin: CoordMode, Mouse, Screen MouseGetPos, mposX, mposY WinMove, ahk_ID %win3hwnd%,, (mposX-omposX), (mposY-omposY) Return ; ##### Hotkeys ################################################################ ^#q:: ExitApp ; ##### Functions ############################################################## WM_LBUTTONDOWN(wparam, lparam) { Global omposX, omposY , w1X, w3X, w1Y, w3Y , win1hwnd, win2hwnd, win3hwnd, w31X, w31Y , mv1, slactive Sleep, 50 If (A_GUI = 3 AND !mv1 AND !slactive) { mv1 := True CoordMode, Mouse, Relative MouseGetPos, omposX, omposY WinGetPos, w1X, w1Y,,, ahk_ID %win1hwnd% WinGetPos, w3X, w3Y,,, ahk_ID %win3hwnd% w31X := w3X - w1X w31Y := w3Y - w1Y WinSet, Transparent, 0, ahk_ID %win2hwnd% WinSet, Transparent, 0, ahk_ID %win1hwnd% SetTimer, Movewin, 150 } Return } WM_LBUTTONUP(wparam, lparam) { Global omposX, omposY , w1X, w31X, w3X, w1Y, w31Y, w3Y , win1hwnd, win2hwnd, win3hwnd , mv1, CustomColor If (A_GUI = 3 AND !slactive AND mv1) { SetTimer, Movewin, Off WinGetPos, w3X, w3Y,,, ahk_ID %win3hwnd% WinMove, ahk_ID %win2hwnd%,, (w3X + 248), (w3Y + 107) WinMove, ahk_ID %win1hwnd%,, (w3X - w31X), (w3Y - w31Y) WinSet, TransColor, %CustomColor%, ahk_ID %win2hwnd% WinSet, TransColor, %CustomColor%, ahk_ID %win1hwnd% mv1= } Return } WM_WINDOWPOSCHANGING(wParam, lParam) { If (lparam = 8909000 AND A_GUI <> 1 AND !slactive) { If A_GUI = 3 Gui, 3:Show Else If A_GUI = 2 Gui, 2:Show } Return } WM_WINDOWPOSCHANGED(wParam, lParam) { If (lparam = 8910432 AND A_GUI = 1 AND !slactive) { Gui, 3:Show, Hide Gui, 2:Show, Hide } Return }