Arterie Posted June 3, 2009 Posted June 3, 2009 I want to hide my mouse because i want to make a little game and the mouse shouldnt be visible. Maybe i could make it transparent or hide it behind the window. MfG Arterie
Valuater Posted June 3, 2009 Posted June 3, 2009 Maybe.. #Include <Misc.au3> _MouseTrap (@DesktopWidth,@DesktopHeight,@DesktopWidth,@DesktopHeight) Sleep(5000) _MouseTrap () 8)
Inverted Posted June 3, 2009 Posted June 3, 2009 _MouseTrap sucks For example, I can double-click to get out of it. Or ctrl+ESC, Or ctrl+alt+del Also, when the user alt-tabs away from the game, mouse is still trapped ... bleh
wolf9228 Posted June 3, 2009 Posted June 3, 2009 I want to hide my mouse because i want to make a little game and the mouse shouldnt be visible. Maybe i could make it transparent or hide it behind the window. MfG Arterie expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("") GUISetBkColor(0xFFCC99) GUISetState(@SW_SHOW) Global $CHKMOUSE = 0 While 1 $size = WinGetPos($Form1) $pos = MouseGetPos() if IsArray($pos) And IsArray($size) Then if $pos[0] >= $size[0] And $pos[0] <= ($size[0] + $size[2] ) And _ $pos[1] >= $size[1] And $pos[1] <= ($size[1] + $size[3]) Then ShowCursor(False) SetCapture($Form1) $CHKMOUSE = 1 Else IF $CHKMOUSE = 1 Then ShowCursor(True) ReleaseCapture() $CHKMOUSE = 0 EndIf EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func ReleaseCapture() $DllCall = DllCall("user32.dll" , "int" , "ReleaseCapture") Return $DllCall[0] EndFunc Func SetCapture($hWnd) $DllCall = DllCall("user32.dll" , "hWnd" , "SetCapture","hWnd",$hWnd) Return $DllCall[0] EndFunc Func ShowCursor($BOOL_bShow) $DllCall = DllCall("user32.dll" , "int" , "ShowCursor","int",$BOOL_bShow) Return $DllCall[0] EndFunc صرح السماء كان هنا
Arterie Posted June 7, 2009 Author Posted June 7, 2009 Thanks wolf this was exactly what i am looking for
goldenix Posted June 12, 2009 Posted June 12, 2009 (edited) As far as I can understand ShowCursor shows the cursor, but what areSetCapture ReleaseCapture for?Can someone explain?Lets say I just want to hide the cursor for 3 seconds how do I do it? MY window Title is IrfanView?This does not work:Opt("WinTitleMatchMode", 4) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase Sleep(3000) $hWnd = WinGetHandle("[CLASS:IrfanView]") DllCall("user32.dll" , "int" , "ShowCursor","int",False) DllCall("user32.dll" , "hWnd" , "SetCapture","hWnd",$hWnd) Sleep(3000) DllCall("user32.dll" , "int" , "ShowCursor","int",True) DllCall("user32.dll" , "int" , "ReleaseCapture") Edited June 12, 2009 by goldenix My Projects:[list][*]Guide - ytube step by step tut for reading memory with autoitscript + samples[*]WinHide - tool to show hide windows, Skinned With GDI+[*]Virtualdub batch job list maker - Batch Process all files with same settings[*]Exp calc - Exp calculator for online games[*]Automated Microsoft SQL Server 2000 installer[*]Image sorter helper for IrfanView - 1 click opens img & move ur mouse to close opened img[/list]
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