fi3ldy Posted January 17, 2007 Posted January 17, 2007 (edited) Hey, stuck again Im using $WS_POPUP in my GUICreate, so i have no titlebar or menubar, whatever you want to call it. I was wondering if there was a way to select a region in your window which is the same as being able to click on the titlebar/menubar and dragging/moving the window anywhere on your screen... (titlebar/menubar being bar with name of window and minimize, maximize and close buttons on (i know your not an idiot, im the one thats not sure on the proper name for titlebar/menubar)) Thanks alot guys. Edited January 17, 2007 by fi3ldy
fi3ldy Posted January 18, 2007 Author Posted January 18, 2007 take it there is no way ? is there any alternatives u guys know of? and comments appriciated
James Posted January 18, 2007 Posted January 18, 2007 ProSpeed.dll, I know there is no menu bar on the demo. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
fi3ldy Posted January 18, 2007 Author Posted January 18, 2007 cheers for the repy, yes thats my point, theres no menu bar, so how can you move the window around on ur screen?
Zedna Posted January 18, 2007 Posted January 18, 2007 Another way:#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) EndFuncLook here Resources UDF ResourcesEx UDF AutoIt Forum Search
fi3ldy Posted January 18, 2007 Author Posted January 18, 2007 Really appriciated the hlpe im recieving! Went for the second method, works awsome! big kiss for u ;p
Helge Posted January 18, 2007 Posted January 18, 2007 ...I was wondering if there was a way to select a region in your window...Well, with Zedna's code the window will be dragged whenever you click anything in the GUI...even if you happen tomove the mouse while pressing a button or similar, the window will be moved as well. Using a label and simply settingthe style to $GUI_WS_EX_PARENTDRAG will limit the moving of the window to the label only (or region if you want)instead of the entire window.You're not even adding another line to your code as you're just setting the style, and after that everything is handledautomagically for you. Anyway, you can also add some checking to Zedna's code to do the same, to ensure that thewindow is moved only when over a specific control, by using GUIGetCursorInfo I guess.
GaryFrost Posted January 18, 2007 Posted January 18, 2007 Instead of using primary down you can use controlsi.e.#include <GuiConstants.au3> $GUI = GUICreate("test", 199, 74, -1, -1, BitOR($WS_POPUPWINDOW, $WS_BORDER)) $pic1 = GUICtrlCreatePic(@SystemDir & "\oobe\images\wpakey.jpg", -1, -1, 200, 75) GUICtrlSetState($pic1, $GUI_DISABLE) $Button_Exit = GUICtrlCreateLabel("X", 184, 0, 16, 17, $SS_CENTER, $WS_EX_STATICEDGE) GUICtrlSetFont($Button_Exit, Default, 600) GUICtrlSetColor($Button_Exit, 0xFFFFFF) $Button_Min = GUICtrlCreateLabel("_", 166, 0, 16, 17, $SS_CENTER, $WS_EX_STATICEDGE) $Label = GUICtrlCreateLabel("", 0, 0, 166, 17) GUICtrlSetBkColor($Label, $GUI_BKCOLOR_TRANSPARENT) $Label2 = GUICtrlCreateLabel("", 0, 17, 199, 57) GUICtrlSetBkColor($Label2, $GUI_BKCOLOR_TRANSPARENT) GUICtrlSetColor($Button_Min, 0xFFFFFF) GUICtrlSetFont($Button_Exit, Default, 600) $Button_Text = GUICtrlCreateButton("Test", 30, 30, 50, 25) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $Button_Exit Exit Case $msg = $Button_Min GUISetState(@SW_MINIMIZE) ;~ Case $msg = $Label Or $msg = $Label2 Case $msg = $Label _Drag($GUI) EndSelect WEnd Func _Drag($h_gui) DllCall("user32.dll", "int", "ReleaseCapture") DllCall("user32.dll", "int", "SendMessage", "hWnd", $h_gui, "int", 0xA1, "int", 2, "int", 0) EndFunc ;==>_DragModified from http://www.autoitscript.com/forum/index.ph...st&p=213007 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
fi3ldy Posted January 19, 2007 Author Posted January 19, 2007 i noticed that helge. ill try other methods you guys have given, thanks alot
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now