ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   show icon caption bar in userform (https://www.excelbanter.com/excel-programming/354404-show-icon-caption-bar-userform.html)

tom taol

show icon caption bar in userform
 


i want to show the my icon in left of caption bar on the userform.
how to method?

*** Sent via Developersdex http://www.developersdex.com ***

Bob Phillips[_6_]

show icon caption bar in userform
 
Create an image control with the icon in it and use this code

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" ( _
ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long

Private Const WM_SET_ICON = &H80
Private Const WM_ICON_SMALL = 0&
Private Const WM_ICON_BIG = 1&

Private Sub ChangeMenuBar(frm As Object)
Dim hWnd As Long, hIcon As Long
With frm
If Val(Application.Version) = 9 Then
hWnd = FindWindow("ThunderDFrame", .Caption)
Else
hWnd = FindWindow("ThunderXFrame", .Caption)
End If
hIcon = .imgIcon.Picture.Handle
SendMessage hWnd, WM_SET_ICON, WM_ICON_BIG, ByVal hIcon
.imgIcon.Visible = False
.Show
End With
End Sub

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"tom taol" wrote in message
...


i want to show the my icon in left of caption bar on the userform.
how to method?

*** Sent via Developersdex http://www.developersdex.com ***





All times are GMT +1. The time now is 07:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com