Jump to content

Helping with removing title bar and moving the GUI


 Share

Recommended Posts

Hello,

i've been busy again with AutoIt, but i've got some trouble with it...

does anybody know a code to remove the title bar and move the (whole) GUI screen?

well, i tried to find on the AutoIt Help program, but i couldn't find anything, so please help..

thanks,

- me

Link to comment
Share on other sites

heey,

thnx but the last one what you said didn't work, it only creates s crollbars,

but i want the GUI screen moves with the mouse.

- me

I'm not sure if this is what you want, but I suppose you mean you want the GUI to folow the mouse?

supposed the name of your GUI is mygui

$pos=MouseGetPos()

WinMove("mygui","",$pos[0],$pos[1])

(put that in your While loop)

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

What did you expect would happen, what actually happened and what should happen (in your eyes) ?

Click and drag the label and the GUI will be moved :

#include <GUIConstants.au3>

GUICreate("", 200, 60, -1, -1, $WS_POPUP)
GUICtrlCreateLabel("", 0, 0, 200, 20, -1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0xFF0000)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

EDIT : Clarity

Edited by Helge
Link to comment
Share on other sites

I'm not sure if this is what you want, but I suppose you mean you want the GUI to folow the mouse?

supposed the name of your GUI is mygui

$pos=MouseGetPos()

WinMove("mygui","",$pos[0],$pos[1])

(put that in your While loop)

ah that's what im searching for!!

weird, the AutoIt Help commands doesn't say anything about this command, but thanks for the help

all folks :)

- me

Link to comment
Share on other sites

Another way to do it:

#include <GUIConstants.au3>

Const $HTCAPTION = 2
Const $WM_NCLBUTTONDOWN = 0xA1

$gui = GuiCreate("Test",200,60,-1,-1,BitOR($WS_POPUP,$WS_BORDER)) 
GUISetState(@SW_SHOW)

While 1
    Switch GuiGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $GUI_EVENT_PRIMARYDOWN
            Drag()
    EndSwitch
WEnd

Func Drag()
    dllcall("user32.dll","int","ReleaseCapture")
    dllcall("user32.dll","int","SendMessage","hWnd", $gui,"int",$WM_NCLBUTTONDOWN,"int", $HTCAPTION,"int", 0)
EndFunc
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...