Всё таки интересно почему нет в MousePointer вариант Hand.
Неужели VB такой старый?
И как эту самую ручку изобразить при движении на Label-е?
Спасибо за внимание.
AlexBlack писал(а):Отлично! Легко и просто. Как выковырять ИКО с ручкой из системы? Причем не ручку по умолчанию, а установленную?
Option Explicit
Private Declare Function LoadImage Lib "user32.dll" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As Long, ByVal un1 As Long, ByVal n1 As Long, ByVal n2 As Long, ByVal un2 As Long) As Long
Private Declare Function OleCreatePictureIndirect Lib "oleaut32" (ByRef lpPictDesc As PicBmp, riid As GUID, ByVal fOwn As Long, ByRef lplpvObj As Any) As Long
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(0 To 7) As Byte
End Type
Private Type PicBmp
Size As Long
Type As PictureTypeConstants
hBmp As Long
hPal As Long
Reserved As Long
End Type
Private Const IMAGE_CURSOR As Long = 2
Private Const OCR_HAND As Long = 32649
Private Const LR_DEFAULTSIZE As Long = &H40
Private Const LR_SHARED As Long = &H8000
Private Sub Form_Load()
Me.MousePointer = vbCustom
Set Me.MouseIcon = GetPictureFromHandle(LoadImage(0, OCR_HAND, IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE Or LR_SHARED), vbPicTypeIcon)
End Sub
Public Function GetPictureFromHandle(ByVal Handle As Long, ByVal PictureType As PictureTypeConstants) As IPictureDisp
Dim p As PicBmp, g As GUID
With p
.hBmp = Handle
.Size = Len(p)
.Type = PictureType
End With
'IDispatch
With g
.Data1 = &H20400
.Data4(0) = &HC0
.Data4(7) = &H46
End With
OleCreatePictureIndirect p, g, 0, GetPictureFromHandle
End Function
Сейчас этот форум просматривают: SemrushBot и гости: 139