Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
#Resource RCDATA, HAND, "dragdrop.cur"
Function PBMain() As Long
Local hDlg AS DWord
DIALOG NEW PIXELS, 0, "Test Code",300,300,200,200, %WS_OVERLAPPEDWINDOW TO hDlg
CONTROL ADD BUTTON, hDlg, 100, "Hover", 50,10,100,20
DIALOG SHOW MODAL hDlg CALL DlgProc
End Function
CallBack Function DlgProc() As Long
STATIC hCursor AS DWord
SELECT CASE CB.MSG
CASE %WM_INITDIALOG
OPEN TempDir() + "Temp.cur" FOR BINARY AS #1
PUT$ #1, RESOURCE$(RCDATA, "HAND")
CLOSE #1
hCursor = LoadCursorFromFile(TempDir() + "Temp.cur")
KILL TempDIR() + "Temp.cur"
CASE %WM_SetCursor
IF CB.WPARAM = GetDlgItem(CB.HNDL, 100) THEN
MOUSEPTR hCursor : Function = 1
END IF
END SELECT
End Function
Function TempDir() As String
Local lpBuffer As AsciiZ * %MAX_PATH
GetTempPath(%MAX_PATH, lpBuffer)
Function = lpBuffer
End Function
'gbs_00849
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm