Sign in to follow this  
Followers 0
zvvyt

Need help w/ GUIExtender-UDF

8 posts in this topic

Hello there.

I'm currently trying to solve a problem I'm having with the GUIExtender-UDF by Melba23, but I can't relly get the hang of it and I think I need someone to straightening this out for me.

What I'm trying to achieve is a "menu-ish" GUI with buttons that takes you deeper and further into the menues, and aswell to have a back-button which lets you return to the previously extended section. I've done this before with the use of multiple child GUIs being hidden/shown, but that was taking too much out of the computer as I'll be working with 20+ windows/sections.

What I've been testing so far is the following:

#include "GUIExtender.au3"
#include <GUIConstantsEx.au3>

$GUI = GUICreate("Test",500,300,-1,-1)

_GUIExtender_Init($GUI, 1)
$Back = GUICtrlCreateButton("Back",50,20,50,25)
$Window1 = _GUIExtender_Section_Start(50, 500)
_GUIExtender_Section_Action($Window1)
$Button1 = GUICtrlCreateButton("Button1",100,100,100,30)
_GUIExtender_Section_End()
$Window2 = _GUIExtender_Section_Start(50, 500)
_GUIExtender_Section_Action($Window2)
$Button2 = GUICtrlCreateButton("Button2",150,100,100,30)
_GUIExtender_Section_End()
$Window3 = _GUIExtender_Section_Start(50, 500)
_GUIExtender_Section_Action($Window3)
$Button3 = GUICtrlCreateButton("Button3",250,100,100,30)
_GUIExtender_Section_End()
_GUIExtender_Section_Extend(0, False,0)
_GUIExtender_Section_Extend($Window1, True,0)
GUISetState()
while 1

Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
case $Button1
_GUIExtender_Section_Extend(0, False,0)
_GUIExtender_Section_Extend($Window2, True,0)
case $Button2
_GUIExtender_Section_Extend(0, False,0)
_GUIExtender_Section_Extend($Window3, True,0)
case $Button3
_GUIExtender_Section_Extend(0, False,0)
_GUIExtender_Section_Extend($Window1, True,0)
case $Back
EndSwitch
WEnd

When I just had 2 sections created the extend/retract worked as I think it should, which is hideing one and showing the other. But as I added the 3rd section by using the same terms as the precious 2 it's now having both section 2 & 3 extended at same time and somewhat linking them togeather, idk.

I've tried to get the hang of this by the examples provided by Melba and by the UDF itself, but it seem like I got something wrong..

Best regards,

zvvyt

Share this post


Link to post
Share on other sites



Bumping for my own interests

Share this post


Link to post
Share on other sites

zvvyt,

I think this is what you need: ;)

#include <GUIConstantsEx.au3>

#include "GUIExtender.au3"

; Cretae an array to hold the section index numbers
Global $aSection[4]

$hGUI = GUICreate("Test", 600, 300)

_GUIExtender_Init($hGUI, 1)

$aSection[1] = _GUIExtender_Section_Start(0, 200)
_GUIExtender_Section_Action($aSection[1])
$cBack = GUICtrlCreateButton("Back", 50, 20, 100, 30)
$cButton1 = GUICtrlCreateButton("Open Section 2", 50, 100, 100, 30)
_GUIExtender_Section_End()

; Look at the parameters - they are the start point and the width.  The first is the sum of the parameters for the section before
$aSection[2] = _GUIExtender_Section_Start(200, 200)
_GUIExtender_Section_Action($aSection[2])
$cButton2 = GUICtrlCreateButton("Open section 3", 250, 100, 100, 30)
_GUIExtender_Section_End()

$aSection[3] = _GUIExtender_Section_Start(400, 200)
_GUIExtender_Section_Action($aSection[3])
$cButton3 = GUICtrlCreateButton("Close All", 450, 100, 100, 30)
_GUIExtender_Section_End()

; Close all sections and then open the first
_GUIExtender_Section_Extend(0, False)
_GUIExtender_Section_Extend($aSection[1])

GUISetState()
While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton1
            ; Open the next section
            _GUIExtender_Section_Extend($aSection[2])
        Case $cButton2
            ; Open the next section
            _GUIExtender_Section_Extend($aSection[3])
        Case $cButton3
            ; Close all sections and then open the first
            _GUIExtender_Section_Extend(0, False)
            _GUIExtender_Section_Extend($aSection[1])
        Case $cBack
            ; Look to see which is the last section opened
            For $i = 3 To 2 Step -1
                If _GUIExtender_Section_State($aSection[$i]) Then
                    ; And close it
                    _GUIExtender_Section_Extend($aSection[$i], False)
                    ExitLoop
                EndIf
            Next
    EndSwitch
WEnd

Is that what you wanted? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Hello, Melba! I've been expecting you x)

Is that what you wanted? :huh:

No, not really.

How I would like it is all sections are layered at the same spot, so that the button hides that current "layer" and reveals the next/desired one. Just like how you browse through folders/directories on your computer, more or less.

Something like this, but w/ sections instead of multible child GUIs

#include <WindowsConstants.au3>
#include <winapi.au3>
#include <GUIConstantsEx.au3>

$GUI = GUICreate("Main/Parent",400,500,-1,-1)
GUICtrlCreateLabel("This is on the parent GUI",150,50,100,25)

$Child1 = GUICreate("Child GUI 1",400,450,0,50,$ws_popup,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$GUI)
GUISetBkColor(0xacbdef,$Child1)
_WINAPI_SetLayeredWindowAttributes($Child1, 0xacbdef, 255)
GUICtrlCreateLabel("This is the 1st child GUI",150,50,100,25)
$Child1_Button_To_Child2 = GUICtrlCreateButton("To child #2",150,100,100,25)
$Child1_Button_To_Child3 = GUICtrlCreateButton("To child #3",150,200,100,25)

$Child2 = GUICreate("Child GUI 2",400,450,0,50,$ws_popup,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$GUI)
GUISetBkColor(0xacbdef,$Child2)
_WINAPI_SetLayeredWindowAttributes($Child2, 0xacbdef, 255)
GUICtrlCreateLabel("This is the 2nd child GUI",150,50,100,25)
$Child2_Button_To_Child1 = GUICtrlCreateButton("To child #1",150,100,100,25)
$Child2_Button_To_Child3 = GUICtrlCreateButton("To child #3",150,200,100,25)

$Child3 = GUICreate("Child GUI 3",400,450,0,50,$ws_popup,bitor($WS_EX_MDICHILD, $WS_EX_LAYERED),$GUI)
GUISetBkColor(0xacbdef,$Child3)
_WINAPI_SetLayeredWindowAttributes($Child3, 0xacbdef, 255)
GUICtrlCreateLabel("This is the 3rd child GUI",150,50,100,25)
$Child3_Button_To_Child1 = GUICtrlCreateButton("To child #1",150,100,100,25)
$Child3_Button_To_Child2 = GUICtrlCreateButton("To child #2",150,200,100,25)

GUISetState(@sw_show,$GUI)
GUISetState(@sw_show,$Child1)
while 1
    $msg = GUIGetMsg()
    select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
        case $msg = $Child2_Button_To_Child1 or $msg = $Child3_Button_To_Child1
            GUISetState(@sw_hide,$Child1)
            GUISetState(@sw_hide,$Child2)
            GUISetState(@sw_hide,$Child3)
            GUISetState(@sw_show,$Child1)
        case $msg = $Child1_Button_To_Child2 or $msg = $Child3_Button_To_Child2
            GUISetState(@sw_hide,$Child1)
            GUISetState(@sw_hide,$Child2)
            GUISetState(@sw_hide,$Child3)
            GUISetState(@sw_show,$Child2)
        case $msg = $Child2_Button_To_Child3 or $msg = $Child1_Button_To_Child3
            GUISetState(@sw_hide,$Child1)
            GUISetState(@sw_hide,$Child2)
            GUISetState(@sw_hide,$Child3)
            GUISetState(@sw_show,$Child3)
    EndSelect
WEnd

The winapi is because I'll be having the sections on a transparent child window and a background on the parent.

Tell me if I'm not making any sense!

Best regards,

Share this post


Link to post
Share on other sites

zvvyt,

all sections are layered at the same spot, so that the button hides that current "layer" and reveals the next/desired one

More like this then: :)

#include <GUIConstantsEx.au3>

#include "GUIExtender.au3"

; Create an array to hold the section index numbers
Global $aSection[4]

$hGUI = GUICreate("Section 1", 600, 300)

_GUIExtender_Init($hGUI, 1)

$aSection[1] = _GUIExtender_Section_Start(0, 200)
_GUIExtender_Section_Action($aSection[1])
$cBack1 = GUICtrlCreateButton("Back", 50, 20, 100, 30)
$cButton1 = GUICtrlCreateButton("Open Section 2", 50, 100, 100, 30)
_GUIExtender_Section_End()

; Look at the parameters - they are the start point and the width.  The first is the sum of the parameters for the section before
$aSection[2] = _GUIExtender_Section_Start(200, 200)
_GUIExtender_Section_Action($aSection[2])
$cBack2 = GUICtrlCreateButton("Back", 250, 20, 100, 30)
$cButton2 = GUICtrlCreateButton("Open section 3", 250, 100, 100, 30)
_GUIExtender_Section_End()

$aSection[3] = _GUIExtender_Section_Start(400, 200)
_GUIExtender_Section_Action($aSection[3])
$cBack3 = GUICtrlCreateButton("Back", 450, 20, 100, 30)
$cButton3 = GUICtrlCreateButton("Close All", 450, 100, 100, 30)
_GUIExtender_Section_End()

; Close all sections and then open the first
_GUIExtender_Section_Extend(0, False)
_GUIExtender_Section_Extend($aSection[1])

GUISetState()
While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton1
            ; Open the next section
            _GUIExtender_Section_Extend(0, False)
            _GUIExtender_Section_Extend($aSection[2])
            WinSetTitle($hGUI, "", "Section 2")
        Case $cButton2
            ; Open the next section
            _GUIExtender_Section_Extend(0, False)
            _GUIExtender_Section_Extend($aSection[3])
            WinSetTitle($hGUI, "", "Section 3")
        Case $cButton3
            ; Close all sections and then open the first
            _GUIExtender_Section_Extend(0, False)
            _GUIExtender_Section_Extend($aSection[1])
            WinSetTitle($hGUI, "", "Section 1")
        Case $cBack1, $cBack2, $cBack3
            ; Look to see which is the last section opened
            For $i = 3 To 2 Step -1
                If _GUIExtender_Section_State($aSection[$i]) Then
                    ; Close it
                    _GUIExtender_Section_Extend($aSection[$i], False)
                    ; And open the previous
                    _GUIExtender_Section_Extend($aSection[$i - 1])
                    ; Change the title
                    WinSetTitle($hGUI, "", "Section " & $i - 1)
                    ExitLoop
                EndIf
            Next
    EndSwitch
WEnd

Closer? :huh:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Closer? :huh:

Not only close, but exactly as i wanted it!

And the way you formed the "back"-function and putting the sections into an array was just spot on!

So what I did wrong was to set the _GUIExtender_Section_Start-parameter wrong? Must've gotten that wrong from the description in the UDF then >_<

And while we're at it, do you have any suggestion how to solve the back-function if I f.ex. got several "categories"?

Say I've got 2 main categories, "Names" and "Numbers" were "Names" have the subcategories "A", "B", "C" ... and "Numbers" got the subcats "1", "2", "3"...

Just need a hint or poke in the right direction, the script I think I can manage myself =)

Thanks once again!

Best regards,

zvvyt

Share this post


Link to post
Share on other sites

zvvyt,

That was harder than I thought it should be - I will have another think about how you might do it this afternoon: :sweating:

#include <GUIConstantsEx.au3>

#include "GUIExtender.au3"

; Create an array to hold the section index numbers and button ControlIDs
Global $aSection[8], $aButton[8], $aBack[8]

$hGUI = GUICreate("Start", 1400, 300, @DesktopWidth / 2)

_GUIExtender_Init($hGUI, 1)

$aSection[1] = _GUIExtender_Section_Start(0, 200)
_GUIExtender_Section_Action($aSection[1])
$aButton[0] = GUICtrlCreateButton("Open Letters", 50, 100, 100, 30)
$aButton[1] = GUICtrlCreateButton("Open Numbers", 50, 150, 100, 30)
_GUIExtender_Section_End()

; Create the "Letters" sections
$aSection[2] = _GUIExtender_Section_Start(200, 200)
_GUIExtender_Section_Action($aSection[2])
$aBack[2] = GUICtrlCreateButton("Back", 250, 20, 100, 30)
$aButton[2] = GUICtrlCreateButton("Open 'Letters 2'", 250, 100, 100, 30)
_GUIExtender_Section_End()

$aSection[3] = _GUIExtender_Section_Start(400, 200)
_GUIExtender_Section_Action($aSection[3])
$aBack[3] = GUICtrlCreateButton("Back", 450, 20, 100, 30)
$aButton[3] = GUICtrlCreateButton("Open 'Letters 3'", 450, 100, 100, 30)
_GUIExtender_Section_End()

$aSection[4] = _GUIExtender_Section_Start(600, 200)
_GUIExtender_Section_Action($aSection[4])
$aBack[4] = GUICtrlCreateButton("Back", 650, 20, 100, 30)
$aButton[4] = GUICtrlCreateButton("Restart", 650, 100, 100, 30)
_GUIExtender_Section_End()

; Create the "Numbers" sections
$aSection[5] = _GUIExtender_Section_Start(800, 200)
_GUIExtender_Section_Action($aSection[5])
$aBack[5] = GUICtrlCreateButton("Back", 850, 20, 100, 30)
$aButton[5] = GUICtrlCreateButton("Open 'Numbers 2'", 850, 100, 100, 30)
_GUIExtender_Section_End()

$aSection[6] = _GUIExtender_Section_Start(1000, 200)
_GUIExtender_Section_Action($aSection[6])
$aBack[6] = GUICtrlCreateButton("Back", 1050, 20, 100, 30)
$aButton[6] = GUICtrlCreateButton("Open 'Numbers 3'", 1050, 100, 100, 30)
_GUIExtender_Section_End()

$aSection[7] = _GUIExtender_Section_Start(1200, 200)
_GUIExtender_Section_Action($aSection[7])
$aBack[7] = GUICtrlCreateButton("Back", 1250, 20, 100, 30)
$aButton[7] = GUICtrlCreateButton("Restart", 1250, 100, 100, 30)
_GUIExtender_Section_End()

; Close all sections and then open the first
_GUIExtender_Section_Extend(0, False)
_GUIExtender_Section_Extend($aSection[1])

GUISetState()

While 1

    $iMsg = GUIGetMsg()
    Switch $iMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case Else
            ; Check it is a valid ControlID as we have empty elements in the array which will fire on 0
            If $iMsg > 0 Then
                ; Now look at each section in turn
                For $i = 0 To 7
                    ; Look for "Forward" buttons
                    If $aButton[$i] = $iMsg Then
                        Switch $i
                            Case 0, 1
                                ; Close all sections
                                _GUIExtender_Section_Extend(0, False)
                                ; Open the first relevant section
                                $iSection = 2 + (3 * $i)
                                _GUIExtender_Section_Extend($aSection[$iSection])
                                ; Change title
                                If $i = 0 Then
                                    WinSetTitle($hGUI, "", "Letters 1")
                                Else
                                    WinSetTitle($hGUI, "", "Numbers 1")
                                EndIf
                            Case 2, 3, 5, 6
                                ; Close all sections
                                _GUIExtender_Section_Extend(0, False)
                                ; Open the next
                                _GUIExtender_Section_Extend($aSection[$i + 1])
                                ; Change title
                                If $i < 4 Then
                                    WinSetTitle($hGUI, "", "Letters " & $i)
                                Else
                                    WinSetTitle($hGUI, "", "Numbers " & $i - 3)
                                EndIf
                            Case 4, 7
                                ; Close all sections
                                _GUIExtender_Section_Extend(0, False)
                                ; Open the first
                                _GUIExtender_Section_Extend($aSection[1])
                                ; Change title
                                WinSetTitle($hGUI, "", "Start")
                        EndSwitch
                        ExitLoop
                    EndIf

                    ; Now look for "Back" buttons
                    If $aBack[$i] = $iMsg Then
                        ; Look to see which is the last section opened
                        For $j = 7 To 2 Step -1
                            If _GUIExtender_Section_State($aSection[$j]) = 1 Then
                                Switch $j
                                    Case 2, 5
                                        ; Close all sections
                                        _GUIExtender_Section_Extend(0, False)
                                        ; Open the first
                                        _GUIExtender_Section_Extend($aSection[1])
                                        ; Change title
                                        WinSetTitle($hGUI, "", "Start")
                                    Case 3, 4
                                        ; Close all sections
                                        _GUIExtender_Section_Extend(0, False)
                                        ; Open the previous
                                        _GUIExtender_Section_Extend($aSection[$j - 1])
                                        WinSetTitle($hGUI, "", "Letters " & $j - 2)
                                    Case 6, 7
                                        ; Close all sections
                                        _GUIExtender_Section_Extend(0, False)
                                        ; Open the previous
                                        _GUIExtender_Section_Extend($aSection[$j - 1])
                                        WinSetTitle($hGUI, "", "Numbers " & $j - 5)
                                EndSwitch
                                ExitLoop
                            EndIf
                        Next
                    EndIf
                Next
            EndIf
    EndSwitch

WEnd

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

That was harder than I thought it should be

Are you thinking about the back-function with this script?

Isn't it possible to just have an array or variable declared as you move further into the categories, and then have a _GUIExtender_Section_Extend($Last_category) to have the last one shown and so on?

And that "back"-part of your most recent code seem to work for that script at least =)

Best regards,

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Similar Content

    • FrancescoDiMuro
      By FrancescoDiMuro
      Good morning community!
      I was working on a script which read the content of a .ini file to retrieve the file that has to open, and, based on the value of a second key stored in the .ini file, set the window on top, minimized or maximized...
      I did something like this, but seems to not work properly...
      Could anyone please tell me what I'm doing wrong?
      Thank you  
       
      #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Outfile_x64=prova.exe #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include <AutoItConstants.au3> ;#include <WinAPIEx.au3> #include <Array.au3> Local $sFileConfigurazione = @ScriptDir & "\configurazione_exe.ini" If(FileExists($sFileConfigurazione)) Then Local $aSezioneIni = IniReadSection($sFileConfigurazione, "CONFIGURAZIONE_EXE") If @error Then MsgBox($MB_ICONERROR, "Errore!", "Errore durante l'apertura del file: " & @CRLF & $sFileConfigurazione & @CRLF & "Errore: " & @error) Else ; Lancio dell'applicativo indicato nel file di configurazione Local $iPID = ShellExecute($aSezioneIni[1][1]) Local $hWnd If($iPID <> 0) Then Local $aWinList = WinList() For $i = 1 To $aWinList[0][0] If(WinGetProcess($aWinList[$i][1] = $iPID)) Then $hWnd = $aWinList[$i][1] EndIf Next Switch($aSezioneIni[2][1]) Case $aSezioneIni[2][1] = "MIN" ToolTip("MIN", 0, 0) WinSetState($hWnd, WinGetTitle($hWnd), @SW_MINIMIZE) Case $aSezioneIni[2][1] = "MAX" ToolTip("MAX", 0, 0) WinSetState($hWnd, WinGetTitle($hWnd), @SW_MAXIMIZE) Case $aSezioneIni[2][1] = "TOP" ToolTip("TOP", 0, 0) WinSetOnTop($hWnd, WinGetTitle($hWnd), $WINDOWS_ONTOP) EndSwitch EndIf EndIf EndIf And the .ini file is like this:
       
      [CONFIGURAZIONE_EXE] PercorsoExe=Here goes the path and the .exe to execute ModalitaAperturaExe=Here goes one of the value below /* TOP Shows the windows on top */ /* MIN Shows the window minimized */ /* MAX Shows the window maximized */  
    • algiuxas
      By algiuxas
      Hello,
      I'm trying to make cursor for my program, and I need to make it on top but not active when pressed on start menu, taskbar or etc. (cursor appears behind taskbar/start menu).
      Somebody could help me with this problem?
      ; A bit of my script #include <GUIConstants.au3> #include <WindowsConstants.au3> #include <WinAPI.au3> #include <GDIPlus.au3> #include <GuiListBox.au3> Global $Bitmap_Mouse_Pic_Dir = @ScriptDir&"\Cursor.png" Global $Bitmap_Mouse_Pic = _GetWHI($Bitmap_Mouse_Pic_Dir) Global $Bitmap_Mouse_PicSel_Dir = @ScriptDir&"\Selection.png" Global $Bitmap_Mouse_PicSel = _GetWHI($Bitmap_Mouse_PicSel_Dir) Global $Bitmap_Mouse_Opt = 255 ; ... For $i = 0 to 0 $GP_guicur[$i] = GUICreate("GP Cursor", 64, 64, $POS[$i][0], $POS[$i][1], $WS_POPUP, $WS_EX_LAYERED, $GUI) WinSetOnTop($GP_curgui[$i],"",1) SetBitmap($GP_curgui[$i], $Bitmap_Mouse_Pic, $Bitmap_Mouse_Opt) GUISetState(@SW_SHOW) Next ; ... For ; ... Sleep(1000) MouseClick("left",5,@DesktopHeight-5) ; ... Next Exit ;______________________________________________________________________; ; Original program by Ejoc ; ; Improved by Adam1213 (autoit 3.2 compatiblity + improved labels; ;______________________________________________________________________; ; $sImage = Path to your image ; Returns = Array[3] ; $Array[0] = Width ; $Array[1] = Height ; $Array[2] = handle to a HBITMAP ; when the image is no longer needed use _WinAPI_DeleteObject($Array[2]) Func _GetWHI($sImage) Local $hImage, $aBitmap[3] _GDIPlus_Startup() $hImage = _GDIPlus_ImageLoadFromFile($sImage) $aBitmap[0] = _GDIPlus_ImageGetWidth($hImage) $aBitmap[1] = _GDIPlus_ImageGetHeight($hImage) $aBitmap[2] = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Return $aBitmap EndFunc ;==>_GetWHI ; I changed this so I could shutdown gdiplus once an image has been loaded by _GetWHI() ; just pass it the array returned by _GetWHI() Func SetBitmap($hGUI, $aBitmap, $iOpacity) Local Const $AC_SRC_ALPHA = 1 Local $hScrDC, $hMemDC, $hOld, $pSize, $tSize, $pSource, $tSource, $pBlend, $tBlend $hScrDC = _WinAPI_GetDC(0) $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) $hOld = _WinAPI_SelectObject($hMemDC, $aBitmap[2]) $tSize = DllStructCreate($tagSIZE) $pSize = DllStructGetPtr($tSize) DllStructSetData($tSize, "X", $aBitmap[0]) DllStructSetData($tSize, "Y", $aBitmap[1]) $tSource = DllStructCreate($tagPOINT) $pSource = DllStructGetPtr($tSource) $tBlend = DllStructCreate($tagBLENDFUNCTION) $pBlend = DllStructGetPtr($tBlend) DllStructSetData($tBlend, "Alpha", $iOpacity) DllStructSetData($tBlend, "Format", $AC_SRC_ALPHA) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, $pSize, $hMemDC, $pSource, 0, $pBlend, $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteDC($hMemDC) EndFunc ;==>SetBitmap
      Thanks
    • AndreyS
      By AndreyS
      How to make so that the Label control is always on top of all other controls(including pictures and RTF), regardless of their moves, and changes?
      Function GUICtrlSetState($Label, $GUI_ONTOP) does not work.
      Thanks!
    • FireFox
      By FireFox
      Hi,
      I have a child GUI with the $WS_CHILD style inside a main gui, the problem is if there is ctrls (which are on the main GUI) behind the child GUI, they are visible, meaning that they are topmost of the child GUI.

      I there a solution to this, like making the child GUI on top ?

      P.S : I'm off to use the _WinAPI_SetParent.

      Br, FireFox.
    • zvvyt
      By zvvyt
      Hello there!

      The idea I'm having is the following:
      To have a GUI with the left half scrollable and to have a background image which is "fixed" and won't be moved with the scrolling.

      To do this I've so far come up with:
      Placing the backgrond image onto a parent GUI
      Creating a child GUI to the parent, ontop of the left half of the parent
      Using "GUIScrollbars_Ex.au3" to easy insert my scrollbars into the child gui

      The problem I'm having is that the background image places itself ontop of the child GUI, making the child not visible.
      I have tried placing the same background image into the child GUI to recieve the same result I want, but by doing so the image will move with my scrolling. (The right half of the parent is covered by another image, so that's why I'm able of placing the same background image into the child GUI)

      If I'm somehow able of placing the background image "behind" the child GUI I could use either a transparent .GIF or .PNG to make the child window show the image aswell as my controls.

      Any direct thoughts about this, or do you need me to post some of the code?

      Best regards,