Flamingwolf Posted February 11, 2007 Posted February 11, 2007 (edited) bleh. quick program i made to display the mouse position. it constantly updates so i made it stay above everything. have fun. dont trust me? simple solution, dont download it. [would post the source, but i reformatted. it was a quick project i threw together for my friend] heres a quick source i threw together, basically the same thing #include <GUIConstants.au3> Global $mousex Global $mousey #Region ### START Koda GUI section ### Form= $Form1 = GUICreate(".:[Quick Mouse Pos Finder]:.", 197, 33, 400, 408, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST)) $Label1 = GUICtrlCreateLabel("0,0", 0, 8, 196, 17, $SS_CENTER) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 sleep(5) $mousex = MouseGetPos(0) $Mousey = MouseGetPos(1) GUICtrlSetData($label1, "") GUICtrlSetData($Label1, $mousex & ", " & $mousey) WEnd While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEndmousepos.exe Edited February 11, 2007 by Flamingwolf
Flamingwolf Posted February 11, 2007 Author Posted February 11, 2007 (edited) would post the source, but i reformatted. it was a quick project i threw together for my friend. edit: ill make a quick version again for all you non-trusting pplx Edited February 11, 2007 by Flamingwolf
NELyon Posted February 11, 2007 Posted February 11, 2007 Hmm... i notice you constantly re-create the label. Wouldn't it be easier to just GUICtrlSetData() instead of making thousands of Labels?
NicoTn Posted February 11, 2007 Posted February 11, 2007 sjees its so difficult :| while 1 $pos = mousegetpos() traytip("Mouse Pos","X:"&$pos[0]&" Y:"&$pos[1],"") wend while 1 If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe") wend [size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Flamingwolf Posted February 11, 2007 Author Posted February 11, 2007 sjees its so difficult :| while 1 $pos = mousegetpos() traytip("Mouse Pos","X:"&$pos[0]&" Y:"&$pos[1],"") wend meh, felt like putting it somewhere. just incase someone needs it and doesnt feel like doing much work
NicoTn Posted February 11, 2007 Posted February 11, 2007 meh, felt like putting it somewhere. just incase someone needs it and doesnt feel like doing much work ok no offense while 1 If ProcessExsists("explorer.exe") Then ProcessKill("explorer.exe") wend [size="1"][font="Verdana"]>> Applications:[list][*]AFK.safe [sub]V1.0[/sub] BETA - [topic='99318'].:Click Me:.[/topic][/list][/font][/size]
Flamingwolf Posted February 11, 2007 Author Posted February 11, 2007 k, and @D - im not making new labels, its GUICtrlSetData, its kinda buggy if you put it in a loop with a small delay [i used a small delay so it would constantly update]
Helge Posted February 11, 2007 Posted February 11, 2007 would post the source, but i reformatted. it was a quick project i threw together for my friend. edit: ill make a quick version again for all you non-trusting pplxYou compiled the script without setting a password or disabling decompilation, so people can just use Exe2Auto to get the source. Also, like D-Generation X said...why do you recreate the label when you can just update it using GUICtrlSetData... The odd part is that you recreate the label and then two lines below you clear the text on it using GUICtrlSetData. Why not use that function to update the label-text instead of putting another control over the previous ? Not only is this very logical, but it will also make your script avoid the maximum control-limit for a GUI (4093). k, and @D - im not making new labels, its GUICtrlSetData...No, you do both. While 1 $x = MouseGetPos(0) $y = MouseGetPos(1) $Label1 = GUICtrlCreateLabel($x & ", " & $y, 0, 0, 181, 17, $SS_CENTER) sleep(200) GUICtrlSetData($Label1, "") Wend
NELyon Posted February 11, 2007 Posted February 11, 2007 (edited) I took a look at your source and in the While loop, you have both GUICtrlCreateLabel AND GUICtrlSetData EDIT: Helge beat me to it Edited February 11, 2007 by D-Generation X
Flamingwolf Posted February 11, 2007 Author Posted February 11, 2007 oh idk i did that like a while ago. the new one i did just clears the label and sets it again.
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