|
|
|
| Как для разных форм определить разные значки? | |
|
| |
|
|
|
| примерно так (где взял не помню):
это в модуль:
Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long) As Long
Public Declare Function DestroyIcon Lib "user32" _
(ByVal hIcon As Long) As Long
Public Declare Function LoadImage Lib "user32" Alias "LoadImageA" _
(ByVal hInst As Long, ByVal lpsz As String, _
ByVal un1 As Long, ByVal n1 As Long, _
ByVal n2 As Long, ByVal un2 As Long) As Long
Const WM_SETICON = &H80
Const ICON_SMALL = 0
Const IMAGE_ICON = 1
Const LR_LOADFROMFILE = &H10
|
это в модуль формы:
Private Sub Form_Open(Cancel As Integer)
SendMessage Me.hwnd, WM_SETICON, ICON_SMALL, _
LoadImage(0, "C:\Иконка.ICO", IMAGE_ICON, 0, 0, LR_LOADFROMFILE)
End Sub
Private Sub Form_Close()
Dim hIcon As Long
hIcon = SendMessage(hwnd, WM_SETICON, ICON_SMALL, 0)
If hIcon <> 0 Then DestroyIcon hIcon
End Sub
|
| |
|
| |
|