zeroZshadow Posted July 27, 2005 Posted July 27, 2005 Question: is it possible to make a GUI like the wmp in my screenshot here. if so, HOW?? p.s. nice skin he *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
zeroZshadow Posted July 27, 2005 Author Posted July 27, 2005 (edited) well i made something little, but the problem is that i just can't move it. anyone a sollution?? GUIV1.zip Edited July 27, 2005 by zeroZshadow *If u thought life couldn't get worse, u meet me *<guy> What would you give my little sister to unzip ?<friend> 10 bucks<guy> No, i mean like Winzip...
Josbe Posted July 27, 2005 Posted July 27, 2005 well i made something little, but the problem is that i just can't move it.anyone a sollution??GUIV1.zip<{POST_SNAPBACK}>;// Constants $HTCAPTION = 2 $WM_NCLBUTTONDOWN = 0xA1CallsDllCall ("user32.dll", "int", "ReleaseCapture") DllCall ("user32.dll", "int", "SendMessage", "hwnd", $HandleWindow, "int", $WM_NCLBUTTONDOWN, "int", $HTCAPTION, "int", 0) AUTOIT > AutoIt docs / Beta folder - AutoIt latest beta
Helge Posted July 27, 2005 Posted July 27, 2005 Nice one Josbe ! I was searching for that func for a couple of days ago. Thanks !
layer Posted July 28, 2005 Posted July 28, 2005 I've had that one in one of my scripts for awhile, not sure who the original creator is though FootbaG
jpm Posted July 28, 2005 Posted July 28, 2005 ;// Constants $HTCAPTION = 2 $WM_NCLBUTTONDOWN = 0xA1CallsDllCall ("user32.dll", "int", "ReleaseCapture") DllCall ("user32.dll", "int", "SendMessage", "hwnd", $HandleWindow, "int", $WM_NCLBUTTONDOWN, "int", $HTCAPTION, "int", 0)<{POST_SNAPBACK}>I am not sure where to put this fabulous piece of code int the attach code
Zedna Posted July 28, 2005 Posted July 28, 2005 I am not sure where to put this fabulous piece of code int the attach code <{POST_SNAPBACK}>Const $HTCAPTION = 2Const $WM_NCLBUTTONDOWN = 0xA1GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "Drag" )Func Drag() dllcall("user32.dll","int","ReleaseCapture") dllcall("user32.dll","int","SendMessage","hWnd", $gui,"int",$WM_NCLBUTTONDOWN,"int", $HTCAPTION,"int", 0)EndFuncI'm using it this way, so maybe UDF function with similar name _Drag()somewhere in INCLUDE directoryand maybe as parameter should be window to dragand maybe constants inside this function ... Resources UDF ResourcesEx UDF AutoIt Forum Search
jpm Posted July 30, 2005 Posted July 30, 2005 Const $HTCAPTION = 2Const $WM_NCLBUTTONDOWN = 0xA1GUISetOnEvent ($GUI_EVENT_PRIMARYDOWN, "Drag" )Func Drag() dllcall("user32.dll","int","ReleaseCapture") dllcall("user32.dll","int","SendMessage","hWnd", $gui,"int",$WM_NCLBUTTONDOWN,"int", $HTCAPTION,"int", 0)EndFuncI'm using it this way, so maybe UDF function with similar name _Drag()somewhere in INCLUDE directoryand maybe as parameter should be window to dragand maybe constants inside this function ...<{POST_SNAPBACK}>Funny you need to click on the button to drag ... Then it suppresse the quit function
TuMbLeWeEd Posted July 30, 2005 Posted July 30, 2005 Funny you need to click on the button to drag ... Then it suppresse the quit function<{POST_SNAPBACK}>Just dont use the opt(OnEventMode,1)expandcollapse popup#include <GUIConstants.au3> Global Const $HTCAPTION = 2 Global Const $WM_NCLBUTTONDOWN = 0xA1 ;GUI $guiwin = GUICreate("GuiTest", 300,300,30,30,$WS_POPUP,0x00080000) $B2 = GUICtrlCreateButton("quit",200,100,50,50,-1,0x00000020) $Background = GUICtrlCreatePic("Back.gif",0,0,300,300,-1,0x00000020) GUISetState(@SW_SHOW) GuiCtrlSetState($B2,$GUI_FOCUS) While 1 $msg = GUIGetMsg() Select Case $msg = $B2 Exit Case $msg = $Background _GUISkinnedMove($Background,$guiwin) EndSelect sleep(10) WEnd ;=============================================================================== ; ; Description: _GUISkinnedMove ; Parameter(s): $ControlID ; $hwnd ; Requirement: None ; Return Value(s): None ; User CallTip: Event to handle the moving of a gui (for use of a _GUISkinnedCtrlCreateCaptionBar control) ; Author(s): TumbleWeed (tumbleweed_0999@hotmail.com) ; Note(s): None ; ;=============================================================================== Func _GUISkinnedMove($ControlID,$hwnd) ConsoleWrite('@@ (227) :(' & @MIN & ':' & @SEC & ') _GUISkinnedMove()' & @CR);### Trace Function $CursorInf = GUIGetCursorInfo($hwnd) While $CursorInf[2] DllCall("user32.dll", "long", "ReleaseCapture") DllCall("user32.dll", "long", "SendMessage", "hwnd", $hwnd, "int", $WM_NCLBUTTONDOWN, "int", $HTCAPTION, "int", 0) $CursorInf = GUIGetCursorInfo($hwnd) WEnd EndFunc ;==>_GUISkinnedMoveI'm making a GUISkinned UDF, the opt(OnEventMode,1) is to limmited for some stuff (this func is one off the 21 funcs i have now, some not woking the way i want it) Working on this for a while (somtimes that is ) My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
jpm Posted July 30, 2005 Posted July 30, 2005 I dont know why you need to use the "ReleaseCapture" but it work without. the 0x00000020 does not have any effect it is the transparency of the .gif which do the job. It is a good habit to use the GuiConstants.au3 when they exist so 0x00080000 can be replaced by $WS_EX_LAYERED which is exactly what GUICtrlCreatePic doc say.
TuMbLeWeEd Posted July 30, 2005 Posted July 30, 2005 I dont know why you need to use the "ReleaseCapture" but it work without.the 0x00000020 does not have any effect it is the transparency of the .gif which do the job.It is a good habit to use the GuiConstants.au3 when they exist so 0x00080000 can be replaced by $WS_EX_LAYERED which is exactly what GUICtrlCreatePic doc say. <{POST_SNAPBACK}>was just a quick copy of zeroZshadow's code + my functionThe "ReleaseCapture" is there because i grabed the code from the net (some VB code), it was used there and i dont know the purpose of it and never tested without. Maybe it has it's use in VB and not in AutoItMSDN Doc's say:The ReleaseCapture function releases the mouse capture from a window in the current thread and restores normal mouse input processing. A window that has captured the mouse receives all mouse input, regardless of the position of the cursor, except when a mouse button is clicked while the cursor hot spot is in the window of another thread. My AutoIt stuffChatBichProjectSelectorWindow control grabberUsefull LinksPort forwarding with routers
Zedna Posted July 31, 2005 Posted July 31, 2005 Funny you need to click on the button to drag ... Then it suppresse the quit function<{POST_SNAPBACK}>You are right.I used it only with my very simple GUI only with progress control and without any window title bar or another controls. It's a part of my tray based application.So in my simple app it's working fine, but in more complicated apps it must be more exactly handled as TuMbLeWeEd wrote. Resources UDF ResourcesEx UDF AutoIt Forum Search
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