Jump to content

Move windows


PhilipG
 Share

Recommended Posts

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
Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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

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...