я пробовал вот так:
- Код: Выделить всё
Option Explicit
Private Const IMAGE_BITMAP As Long = 0
Private Const BM_SETIMAGE As Long = &HF7&
Private Const LR_LOADFROMFILE As Long = &H10
Private Declare Function LoadImage Lib "user32" Alias "LoadImageA" (ByVal hInst As Long, ByVal lpsz As String, ByVal dwImageType As Long, ByVal dwDesiredWidth As Long, ByVal dwDesiredHeight As Long, ByVal dwFlags As Long) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Integer, ByVal lParam As Any) As Long
Private Declare Function LoadIcon Lib "user32" Alias "LoadIconA" (ByVal hInstance As Long, ByVal lpIconName As Long) As Long
Dim img As Long
Private Sub Form_Load()
img = LoadImage(App.hInstance, "c:\kartinka.bmp", IMAGE_BITMAP, 42, 45, LR_LOADFROMFILE)
SendMessage Command1.hwnd, BM_SETIMAGE, IMAGE_BITMAP, img
End Sub
этот код почему-то у меня не работает. Помогите пожалуйста разобраться в чем тут дело.