This document contains VBA code that defines constants and declares Windows API functions for manipulating the system bar of a userform window. It includes a SystemBarMessageASettings subroutine that finds the window handle of a userform, sends a message to set its system icon, and redraws the menu bar. The code also contains a private sub that calls SystemBarMessageASettings when the userform activates to set the icon.
This document contains VBA code that defines constants and declares Windows API functions for manipulating the system bar of a userform window. It includes a SystemBarMessageASettings subroutine that finds the window handle of a userform, sends a message to set its system icon, and redraws the menu bar. The code also contains a private sub that calls SystemBarMessageASettings when the userform activates to set the icon.
This document contains VBA code that defines constants and declares Windows API functions for manipulating the system bar of a userform window. It includes a SystemBarMessageASettings subroutine that finds the window handle of a userform, sends a message to set its system icon, and redraws the menu bar. The code also contains a private sub that calls SystemBarMessageASettings when the userform activates to set the icon.
This document contains VBA code that defines constants and declares Windows API functions for manipulating the system bar of a userform window. It includes a SystemBarMessageASettings subroutine that finds the window handle of a userform, sends a message to set its system icon, and redraws the menu bar. The code also contains a private sub that calls SystemBarMessageASettings when the userform activates to set the icon.
Download as TXT, PDF, TXT or read online from Scribd
Download as txt, pdf, or txt
You are on page 1of 1
'module
Option Explicit
Private Const FOCO_ICONE = &H80
Private Const ICONE = 0& #If VBA7 Then Private Declare PtrSafe Function SendMessageA Lib "user32" _ (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare PtrSafe Function FindWindowA Lib "user32" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare PtrSafe Function DrawMenuBar Lib "user32" _ (ByVal hWnd As Long) As Long
#Else
Private Declare Function SendMessageA Lib "user32" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Declare Function FindWindowA Lib "user32" _ (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function DrawMenuBar Lib "user32" _ (ByVal hWnd As Long) As Long
#End If
Public Sub SystemBarMessageASettings(frm As Object, imj As Object)
Dim windowHandle As Long Dim hIcone As Long windowHandle = FindWindowA(vbNullString, frm.Caption)