Icona applicazione nella TaskBar




Public Sub SetApplicationIcon(ByVal frm As Form)
Dim status As Long
Dim app_hwnd As Long
Dim hIcon As Long

On Error Resume Next

' Get the topmost window's handle.

status = GetWindowLong(frm.hWnd, GWL_HWNDPARENT)
Do While status <> 0
app_hwnd = status
status = GetWindowLong(app_hwnd, GWL_HWNDPARENT)
Loop
' Get a handle to the icon.

hIcon = SendMessage(frm.hWnd, WM_GETICON, ICON_BIG, ByVal 0)
' Set the application's icon.

SendMessage app_hwnd, WM_SETICON, ICON_BIG, ByVal hIcon
End Sub

Public Sub SetApplicationIcon(ByVal frm As Form)
Dim status As Long
Dim app_hwnd As Long
Dim hIcon As Long

On Error Resume Next

' Get the topmost window's handle.

status = GetWindowLong(frm.hWnd, GWL_HWNDPARENT)
Do While status <> 0
app_hwnd = status
status = GetWindowLong(app_hwnd, GWL_HWNDPARENT)
Loop
' Get a handle to the icon.

hIcon = SendMessage(frm.hWnd, WM_GETICON, ICON_BIG, ByVal 0)
' Set the application's icon.

SendMessage app_hwnd, WM_SETICON, ICON_BIG, ByVal hIcon
End Sub











( iconaapplicazionenellataskbar.html )- by Paolo Puglisi - Modifica del 17/12/2023