Cursor souris

nicolas fr Messages postés 7 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 août 2005 - 1 août 2005 à 04:04
nicolas fr Messages postés 7 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 août 2005 - 1 août 2005 à 19:05

7 réponses

nicolas fr Messages postés 7 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 août 2005
1 août 2005 à 04:19
desoler j'ai effectuer une fauss manip ! donc voila mon problem :

bon voila je voulai creer un petit programm marran qui cach le curseur !mais mon problem es qu'il ne cache le cureur qu sur la feuille form et es donc visible sur le reste de l'ecran .

voila ma source :

Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long

Private Sub Form_Load()
Timer1.Enabled = True
Timer1.Interval = 1000
ShowCursor 0
End Sub

Private Sub lbl_Change()
If lbl = 60 Then
lbl1 = lbl1 + 1
lbl = "00"
End If
End Sub

Private Sub lbl1_Change()
If lbl1 = 60 Then
lbl2 = lbl2 + 1
lbl1 = "00"
End If
End Sub

Private Sub cmd_Click()
lbl = "00"
lbl1 = "00"
lbl2 = "00"
End Sub

Private Sub Timer1_Timer()
lbl = lbl + 1
If lbl = 20 Then
ShowCursor 1
End If
End Sub

Je pense qu c'es un problem d'API ?? non ?

un peu d'aide ne serrai pa de reffus
0
cs_MasterHack Messages postés 586 Date d'inscription jeudi 18 septembre 2003 Statut Membre Dernière intervention 13 février 2008 2
1 août 2005 à 06:38
c se que fais showcursors, ton code est juste.


<HR>

Life is short...Learn more
Copy Rights <> Rights to Copy
0
nicolas fr Messages postés 7 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 août 2005
1 août 2005 à 15:44
ok mais si mon code es just alor pourquoi le cursor n'es cacher que sur la feuille form et non sur tout l'ecran
0
cs_MasterHack Messages postés 586 Date d'inscription jeudi 18 septembre 2003 Statut Membre Dernière intervention 13 février 2008 2
1 août 2005 à 15:49
car c 'est le travail de cette API pas plus.


<HR>

Life is short...Learn more
Copy Rights <> Rights to Copy
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
nicolas fr Messages postés 7 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 août 2005
1 août 2005 à 16:03
Ok , c'es bien ce qu je croyai ! par contr tu pourai pa m'indiquer quelle es l'api qui effectue la tache qu je demande ?
0
Gobillot Messages postés 3140 Date d'inscription vendredi 14 mai 2004 Statut Membre Dernière intervention 11 mars 2019 34
1 août 2005 à 16:39
essayes avec ça, pas envie d'essayer chez moi.

· hCursor

Identifies the cursor. The cursor must have been created by the CreateCursor or loaded by the LoadCursor or LoadImage function. If this parameter is NULL, the cursor is removed from the screen.



Windows 95: The width and height of the cursor must be the values
returned by the GetSystemMetrics function for SM_CXCURSOR and
SM_CYCURSOR. In addition, the cursor bit depth must match the bit depth
of the display or the cursor must be monochrome.





Private Declare Function CreateCursor Lib "user32" (ByVal hInstance As
Long, ByVal nXhotspot As Long, ByVal nYhotspot As Long, ByVal nWidth As
Long, ByVal nHeight As Long, lpANDbitPlane As Any, lpXORbitPlane As
Any) As Long

Private Declare Function DestroyCursor Lib "user32" (ByVal hCursor As Long) As Long

Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Sub Form_Load()

'KPD-Team 1999

'URL: http://www.allapi.net/

'E-Mail: KPDTeam@Allapi.net



' Create a 32x32 color cursor shaped somewhat like a yin-yang symbol.

' (The bit masks come from Microsoft's documentation on the API cursors function, just to

' give them their due credit.) Note how the masks are loaded into the arrays. The new

' cursor is then set to be the cursor for 10 seconds.

Dim hnewcursor As Long ' newly created cursor

Dim holdcursor As Long ' receives handle of default cursor

Dim andbuffer As String, xorbuffer As String ' buffers for masks

Dim andbits(0 To 127) As Byte ' stores the AND mask

Dim xorbits(0 To 127) As Byte ' stores the XOR mask

Dim c As Integer, retval As Long ' counter and return value



' Unfortunately, VB does not provide a nice way to load lots of information into an array.

' To load the AND and XOR masks, we put the raw hex values into the string buffers

' and use a loop to convert the hex values into numeric values and load them into

' the elements of the array. Yes, it's ugly, but there's no better way. Note the

' use of the line-continuation character here. Each sequence of eight hex

' characters represents one line in the 32x32 cursor.

andbuffer = "FFFC3FFF" & "FFC01FFF" & "FF003FFF" & "FE00FFFF" & _


"F701FFFF" & "F003FFFF" & "F003FFFF" & "E007FFFF" & _


"C007FFFF" & "C00FFFFF" & "800FFFFF" & "800FFFFF" & _


"8007FFFF" & "8007FFFF" & "0003FFFF" & "0000FFFF" & _


"00007FFF" & "00001FFF" & "00000FFF" & "80000FFF" & _


"800007FF" & "800007FF" & "C00007FF" & "C0000FFF" & _


"E0000FFF" & "F0001FFF" & "F0001FFF" & "F8003FFF" & _

"FE007FFF" & "FF00FFFF" & "FFC3FFFF" & "FFFFFFFF"

xorbuffer = "00000000" & "0003C000" & "003F0000" & "00FE0000" & _


"0EFC0000" & "07F80000" & "07F80000" & "0FF00000" & _


"1FF00000" & "1FE00000" & "3FE00000" & "3FE00000" & _


"3FF00000" & "7FF00000" & "7FF80000" & "7FFC0000" & _


"7FFF0000" & "7FFF8000" & "7FFFE000" & "3FFFE000" & _


"3FC7F000" & "3F83F000" & "1F83F000" & "1F83E000" & _


"0FC7E000" & "07FFC000" & "07FFC000" & "01FF8000" & _

"00FF0000" & "003C0000" & "00000000" & "00000000"

' Now load these hex values into the proper arrays.

For c = 0 To 127

andbits(c) = Val("&H" & Mid(andbuffer, 2 * c + 1, 2))

xorbits(c) = Val("&H" & Mid(xorbuffer, 2 * c + 1, 2))

Next c

' Finally, create this cursor! The hotspot is at (19,2) on the cursor.

hnewcursor = CreateCursor(App.hInstance, 19, 2, 32, 32, andbits(0), xorbits(0))

' Set the new cursor as the current cursor for 10 seconds and then switch back.

holdcursor = SetCursor(hnewcursor) ' change cursor

Sleep 10000 'Wait 10 seconds

retval = SetCursor(holdcursor) ' change cursor back

' Destroy the new cursor.

retval = DestroyCursor(hnewcursor)

End Sub


Daniel
0
nicolas fr Messages postés 7 Date d'inscription jeudi 21 avril 2005 Statut Membre Dernière intervention 2 août 2005
1 août 2005 à 19:05
desoler , je viens de tester ta source mais elle ne fonctionn plus quan je creer le fichier EXE
0
Rejoignez-nous