관리 메뉴

ㄴrㅎnㅂrㄹrㄱi

X-GUI : Skinnable GUI (창에 스킨을 입히자 윈엠 같은 스킨만들기) 본문

AUTOHOTKEY/스크립트

X-GUI : Skinnable GUI (창에 스킨을 입히자 윈엠 같은 스킨만들기)

님투 2009. 1. 3. 04:32
반응형
X-GUI  제목에서도 뭔가 있을 듯하네요 ^^

다운로드
관련소스

#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
}



미리보기



같은 형태의 창을 만들어 줍니다.



그외 다른 GUI 관련 정보를 얻으시려면  


아직은 만들어 가는 곳입니다. 같이 편집하시고 싶으신 분들은 신청해주세요 편집권한을 드립니다.


반응형
Comments