Jump to content
Sign in to follow this  
PhilipG

Move windows

Recommended Posts

PhilipG

I have a simple question.

My script:

#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>




$width=150
$height=150

$picPath = @ScriptDir &"\Graphic\postit.gif"
$gui = GUICreate("", $width, $height, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)
$ctrl = GUICtrlCreatePic($picPath, 0, 0, $width, $height)
GUICTRLCreateIcon ( @ScriptDir &"\Graphic\more.ico", -1, 6, 3, 10, 10, $SS_NOTIFY)
$close = GUICTRLCreateIcon ( @ScriptDir &"\Graphic\close.ico", -1, 133, 5, 12, 12, $SS_NOTIFY)

GUICtrlCreateLabel("",20,0,110,20,-1, $GUI_WS_EX_PARENTDRAG) ; This is the label

$load = GUICtrlCreateLabel("Initializing...", 10, 100, 220)
GUICtrlSetBkColor($load, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor ( $load, 0xcccccc)
GUISetState(@SW_SHOW)

While 1
        $msg = GUIGetMsg()

    If $msg = $GUI_EVENT_CLOSE or $msg > 0  Then ExitLoop
WEnd

    GUIDelete()

I want the whole GUI window to move when you drag the marked label. But for some reason it doesn't work. I don't understand why

EDIT: Marked Label

Edited by PhilipG

Share this post


Link to post
Share on other sites
Melba23

PhilipG,

The GUI does move if you click on the label. Try colouring it and see exactly where the label is on the GUI. :D

#include <WindowsConstants.au3>
#include <WinAPI.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>

$width=150
$height=150

$gui = GUICreate("", $width, $height, -1, -1, $WS_POPUP, $WS_EX_TOOLWINDOW)

GUICtrlCreateLabel("",20,0,110,20,-1, $GUI_WS_EX_PARENTDRAG)
GUICtrlSetBkColor(-1, 0xFF0000)
$load = GUICtrlCreateLabel("Initializing...", 10, 100, 220)
GUICtrlSetBkColor($load, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor ( $load, 0xcccccc)
GUISetState(@SW_SHOW)

While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE  Then ExitLoop
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
AdmiralAlkex

It works fine here, are you sure you're really pressing on the label?

Also do you really want the script to exit when you do something? You should remove "or $msg > 0".

Edit: Dooh :D

Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
PhilipG

I started write the script just now. right now i just want to move the window...

Witch it still doesn't do for me.

The whole gui is covered with a background pic and the label is gray so i'm quite sure that i do click the right thing but nothings happens when i do.

I have no clue why cause i thought it would

Share this post


Link to post
Share on other sites
PhilipG

I've found the problem!

I had forgot to disable the background pic ctrl, that's why it didn't work, but now it does!

Edited by PhilipG

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  

×