Sign in to follow this  
Followers 0
01b5s4

Question About Resizing/collapsing Gui

4 posts in this topic

#1 ·  Posted (edited)

Hello all,

I'm very new to autoit (this morning new) and I have a couple of questions. I'm trying to create a half transparent GUI that sits over another program and sends keys to it.

The problem is that I need the GUI to (re-size and place the new buttons) when the menu button is clicked. But how do I "close" or re-size the GUI back to it's original size when I click the menu button again? Is there some code for setting the state of a button up/down or something to that effect?

My GUI is attached... Thanks for your help :)

Edited by 01b5s4

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ok, I worked all day to get this far but I still need some assistance. :)

The menu button will now open/close and resize the GUI, but the script seems to have a loop bug because once I run the script, It will keep sending the (!q) part repeatedly.

Can anyone take a look at it for me please? It's attached as a zip file below, and here's the code:

#include <GUIConstants.au3>
#include <file.au3>
Dim $coords,$menuback,$zoomin
_FileReadToArray("coords.ini",$coords)

GUICreate("EXIT_FS", 69, 80,$coords[1],$coords[2],"0x80000080",$WS_EX_TOPMOST)
WinSetTrans("EXIT_FS", "", 255)

$menubutton = GUICtrlCreateButton("", "","", 69, 80,$BS_BITMAP+0x0E00A)
GUICtrlSetImage( -1,"menu.bmp" )
GUICtrlSetState(-1,$GUI_FOCUS)

GUISetState()

While 1

  $msg = GUIGetMsg()

  Select

    Case $msg = $menubutton

    WinMove("EXIT_FS", "", $coords[1], $coords[2], 138, 80)

    $zoomin = GUICtrlCreateButton("", "69","", 69, 80,$BS_BITMAP+0x0E00A)
    GUICtrlSetImage( -1,"item.bmp" )
    GUICtrlSetState(-1,$GUI_FOCUS)

    GUICtrlDelete($menubutton)
    
    $menuback = GUICtrlCreateButton("", "","", 69, 80,$BS_BITMAP+0x0E00A)
    GUICtrlSetImage( -1,"back.bmp" )
    GUICtrlSetState(-1,$GUI_FOCUS)
      
    Case $msg = $zoomin

    WinActivate ("Myapp")
    Send("!q")      

    Case $msg = $menuback

      WinMove("EXIT_FS", "", $coords[1], $coords[2], 69, 80)

    GUICtrlDelete($menuback)
    
    $menubutton = GUICtrlCreateButton("", "","", 69, 80,$BS_BITMAP+0x0E00A)
    GUICtrlSetImage( -1,"menu.bmp" )
    GUICtrlSetState(-1,$GUI_FOCUS)


    Case $msg = $GUI_EVENT_CLOSE
    ;While GuiGetMsg() <> $GUI_EVENT_CLOSE
      ExitLoop
  EndSelect
WEnd
Edited by 01b5s4

Share this post


Link to post
Share on other sites

gafrost, Thank you sooooo much bro. I owe you one :) Everything works great now

try

Dim $coords, $menuback = -999, $zoomin = -999, $open = 0

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