gosu Posted November 13, 2004 Share Posted November 13, 2004 (edited) Can you tell me what´s wrong with this code? I want the cursor to hide and show up again. It just happens nothing DllCall("User32.dll","long","ShowCursor","long",0)Sleep(5000)DllCall("User32.dll","long","ShowCursor","long",1) Edited November 13, 2004 by gosu [quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote] Link to comment Share on other sites More sharing options...
ezzetabi Posted November 13, 2004 Share Posted November 13, 2004 Wrong? nothing. But it seems that AutoIt's dllcall ignores ShowCursor. (I tried also... ) Link to comment Share on other sites More sharing options...
Administrators Jon Posted November 13, 2004 Administrators Share Posted November 13, 2004 (edited) Can you tell me what´s wrong with this code? I want the cursor to hide and show up again. It just happens nothing The code looks ok, but some of the mouse functions don't work like you always expect (like changing the mouse cursor) so it might just not be that easy...Google found this:Introduction Ever wanted to make the mouse cursor invisble? It theory it is a fairly simple thing to achieve using the ShowCursor API call. Pass True to show the cursor and False to hide the cursor. However, you might find that sometimes ShowCursor stops working. The reason for this is that the cursor's internal counter (which is the value returned by the ShowCursor function) gets out of sync. ShowCursor works by keeping an internal counter of calls to ShowCursor. Passing True increments the counter and passing False decrements the counter. The cursor is invisible when the cursor internal counter drops below 0 and is visible at all other times. Straight away you can see that calling the ShowCursor(True) twice and then calling ShowCursor(False) will not make the mouse cursor invisible. You must call ShowCursor(False) once more to do this! Edited November 13, 2004 by Jon Deployment Blog: https://www.autoitconsulting.com/site/blog/ SCCM SDK Programming: https://www.autoitconsulting.com/site/sccm-sdk/ Link to comment Share on other sites More sharing options...
konan Posted November 13, 2004 Share Posted November 13, 2004 Yes I think so! Link to comment Share on other sites More sharing options...
ezzetabi Posted November 13, 2004 Share Posted November 13, 2004 (edited) Yeah!! _CurVisInv(0) MsgBox(0, 'Test time', 'Try to click OK, pal. The cursor is invisible!') _CurVisInv(1) MsgBox(0, 'Test time', 'Try to click OK, pal. This time it is not!') Func _CurVisInv($bV) Local $cursorinternalc Select Case $bV = 1 Do $cursorinternalc = DllCall("User32.dll", "long", "ShowCursor", "long", $bV) Sleep(1) Until $cursorinternalc[0] > 0 Case $bV = 0 Do $cursorinternalc = DllCall("User32.dll", "long", "ShowCursor", "long", $bV) Sleep(1) Until $cursorinternalc[0] < 0 Case Else Return 0 EndSelect ;MsgBox(0, '', $cursorinternalc[0]) Return 1 EndFunc ;==>_CurVisInv Edited November 13, 2004 by ezzetabi Link to comment Share on other sites More sharing options...
gosu Posted November 13, 2004 Author Share Posted November 13, 2004 wow, this is strange. well, thanks! i was just wondering what was wrong about my code [quote name='d2hacker88' date='Jan 6 2005, 05:10 PM']Can someone please help me out with autoit like gimme a link on how to use it cause i have no experience with computer languages and i'd like to make a program with autoit in order to empress my computer teacher.[right][snapback]52215[/snapback][/right][/quote] Link to comment Share on other sites More sharing options...
CyberSlug Posted November 13, 2004 Share Posted November 13, 2004 I believe that function only hides the cursor for the current window.... so it's not really a global setting.... Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! 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