Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long用这个API,把窗体的句柄传进去 参数说明: hwnd ----------- Long,欲为其取得信息的窗口的句柄 nIndex --------- Long,请参考GetWindowLong函数的nIndex参数的说明 dwNewLong ------ Long,由nIndex指定的窗口信息的新值
'使用资源文件 Set Form.MouseIcon = LoadResPicture("MOUSEICON", vbResCursor) Form.MousePointer = VBRUN.vbCustom'使用ImageList Public Property Get CurrentMousePoint() As IPictureDisp Set CurrentMousePoint = MainForm.imagelist1.ListImages(0).ExtractIcon End PropertySet Form.MouseIcon = CurrentMousePoint
参数说明:
hwnd ----------- Long,欲为其取得信息的窗口的句柄 nIndex --------- Long,请参考GetWindowLong函数的nIndex参数的说明 dwNewLong ------ Long,由nIndex指定的窗口信息的新值
Set Form.MouseIcon = LoadResPicture("MOUSEICON", vbResCursor)
Form.MousePointer = VBRUN.vbCustom'使用ImageList
Public Property Get CurrentMousePoint() As IPictureDisp
Set CurrentMousePoint = MainForm.imagelist1.ListImages(0).ExtractIcon
End PropertySet Form.MouseIcon = CurrentMousePoint