Jump to content
Sign in to follow this  
Aceguy

Movable Splash or box on the screen

Recommended Posts

Aceguy

Hello, im a sorta noob to this.... but just need a few ideas to get me started.

My idea is that i would like to move and resive a (Solid Box) and to return the top left position and the size of the box, width and height.

i just dont know where to start.......

Please could you point me in the right direction.

Ace....

Share this post


Link to post
Share on other sites
Paulie

Hello, im a sorta noob to this.... but just need a few ideas to get me started.

My idea is that i would like to move and resive a (Solid Box) and to return the top left position and the size of the box, width and height.

i just dont know where to start.......

Please could you point me in the right direction.

Ace....

GUI in the helpfile can create you a box

use the style

$WS_POPUP

looks like a splash box

Share this post


Link to post
Share on other sites
Aceguy

its growing....

#include <GUIConstants.au3>

$xpos=150
$ypos=150

$mypopup=GUICreate("my popup "&$xpos&" "&$ypos, $xpos,$ypos,300,300,BitAND($WS_CAPTION,$WS_POPUPWINDOW))

GUISetState()

while 1
    GUISetState()
    sleep(100)
WEnd

Share this post


Link to post
Share on other sites
amanda089

I believe it should be BitOR for the gui styles and ex styles, not BitAND

Share this post


Link to post
Share on other sites
Paulie

its growing....

You can take the 'GuiSetState()' Out of the while loop too

Share this post


Link to post
Share on other sites
Aceguy

Yep spot on amada, TY.

#include <GUIConstants.au3>

$xpos=150
$ypos=150

$mypopup=GUICreate("my popup", $xpos,$ypos,300,300,Bitor($WS_CAPTION,$WS_POPUPWINDOW,$WS_SIZEBOX))
$but=GUICtrlCreateButton("Pushme",20,20,50,50)

GUISetState()

while 1
    $msg = GUIGetMsg()
Select  
case $msg = $but
    $size = WinGetPos("my popup")
    
MsgBox(0, "Active window stats (x,y,width,height):", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])

EndSelect
WEnd

However, hanvet yet figured out how to make the co-ordinates update while dragging, any ideas please.

Share this post


Link to post
Share on other sites
Paulie

Yep spot on amada, TY.

(Snip)

However, hanvet yet figured out how to make the co-ordinates update while dragging, any ideas please.

you're close

Cant display things in a msgbox though, because it pauses the script

#include <GUIConstants.au3>

$xpos=150
$ypos=150

$mypopup=GUICreate("my popup", $xpos,$ypos,300,300,Bitor($WS_CAPTION,$WS_POPUPWINDOW,$WS_SIZEBOX))
$but=GUICtrlCreateButton("Pushme",20,20,50,50)

GUISetState()

while 1
     $size = WinGetPos("my popup")  
     $msg = GUIGetMsg()
ToolTip($size[0] & ", " & $size[1] & " - " & $size[2] & "x" & $size[3], $size[0]-10, $Size[1]-10)
Select  
case $msg = $but
    $size = WinGetPos("my popup")
    
MsgBox(0, "Active window stats (x,y,width,height):", $size[0] & " " & $size[1] & " " & $size[2] & " " & $size[3])

EndSelect
WEnd
Edited by Paulie

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.