Torna al Thread

Private Declare Function GetWindowsDirectory Lib "kernel32" Alias "GetWindowsDirectoryA" (ByVal lpBuffer As String, ByVal nSize As Long) As Long Private Declare Function CopyIcon Lib "user32" (ByVal hIcon As Long) As Long Private Declare Function LoadCursorFromFile Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName As String) As Long Private Declare Function SetCursor Lib "user32" (ByVal hCursor As Long) As Long Private Declare Function SetSystemCursor Lib "user32" (ByVal hcur As Long, ByVal id As Long) As Long Private Declare Function GetCursor Lib "user32" () As Long Private Const OCR_NORMAL As Long = 32512 Private currenthcurs As Long Private tempcurs As Long Private newhcurs As Long Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim myDir As String Dim lDir As Long myDir = Space(255) currenthcurs = GetCursor() tempcurs = CopyIcon(currenthcurs) lDir = GetWindowsDirectory(myDir, 255) myDir = "C:\3dgarro.cur" 'Strings.Left$(myDir, lDir) & "\cursors\banana.ani" newhcurs = LoadCursorFromFile(myDir) SetSystemCursor(newhcurs, OCR_NORMAL) End Sub Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click SetSystemCursor(tempcurs, OCR_NORMAL) End Sub
Copyright © dotNetHell.it 2002-2023
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5