CodyBarrett Posted April 4, 2009 Share Posted April 4, 2009 im builing a custom GUI.. and i have a question about mouse dragging.. i can figure out if the primary is clicked... but not when its is held down and i cannot make an event for that what i want: custom titlebar - GOTT! able to move GUI - GOTT able to determine when primary is clicked and move gui then when primary is released gui stops moving... i have this an i just switch between the primary and secondary to move it... While 1 If _IsPressed ('02') Then _WinMove () Sleep (100) WEnd Func _WinMove () while $GUI_EVENT_PRIMARYDOWN Local $x = MouseGetPos (0) Local $y = MouseGetPos (1) WinMove ($GUI, '', $x, $y) If _IsPressed ('01') Then ExitLoop WEnd EndFunc PS all the other code isnt relevent.. so i just included what is.. hence whats up there ^ [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
spudw2k Posted April 4, 2009 Share Posted April 4, 2009 Give this a shot too. #include <GUIConstantsEx.au3> #include <sendmessage.au3> $gui = GUICreate("test",200,200,-1,-1) GUISetState() While 1 $nMsg = GUIGetMsg(1) Switch $nMsg[0] Case $GUI_EVENT_CLOSE Exit Case $GUI_EVENT_PRIMARYDOWN $hWnd = _SendMessage($nMsg[1], 274, 0xF012, 2,1) GUISwitch($nMsg[1]) EndSwitch WEnd Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
CodyBarrett Posted April 4, 2009 Author Share Posted April 4, 2009 alright.. have never seen this before... ill try it out.. isnt there an easyer way like If $GUI_PRIMARY_DOWN then Do ;DO THIS until $GUI_PRIMARY_UP Endif either way ill check into it [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
CodyBarrett Posted April 5, 2009 Author Share Posted April 5, 2009 (edited) alright i looked into it.. but COULD NOT figure out how to get the parameters in _SendMessage()... what im thinking would be easyer.. instead of having the ENTIRE gui background be the target to move if $GUI_EVENT_PRIMARYDOWN happens.. just make my own title bar using GUIctrlcreategraphic().... any ideas guys? on perhaps how to get the values of the parameters or... an easyer solution lol EDIT alright i have settled for this Global $L = GUICtrlCreateLabel ('', 0, 0, 400, 20) GUICtrlSetBkColor ($L, 0xFFFFFF) GUICtrlSetOnEvent ($L, '_WinMove') Func _WinMove () While _IsPressed ('01') Local $x = MouseGetPos (0) Local $y = MouseGetPos (1) WinMove ($GUI, '', $x, $y) WEnd EndFunc that is my custom title bar.. sadely but it will do for now Edited April 5, 2009 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
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