Tabbed Documents icon on captionbar

raphael99

Registered User.
Local time
Today, 09:38
Joined
Apr 6, 2015
Messages
126
Customizing the form with the following code
Code:
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

Public Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
LParam As Any) _
As Long

Public Const LR_LOADFROMFILE = &H10
Public Const IMAGE_BITMAP = 0
Public Const IMAGE_ICON = 1
Public Const WM_SETICON = &H80

Public Function ImpostaCaptionBarImage(hWnd As Long, IconPath As String) As Boolean
Dim IcohWnd As Long

 IcohWnd = LoadImage(0&, IconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE)

If IcohWnd <> 0 Then
Call SendMessage(hWnd, WM_SETICON, 0, ByVal IcohWnd)
ImpostaCaptionBarImage = True
End If
End Function
And OnLoad form:
Code:
Call ImpostaCaptionBarImage(Me.hWnd, "C:\Path\Login.ico")

I can load the little icon on the left on CaptionBar.
It works very well on overlapping mode but no on Tabbed documents. How to works with tabbed documents mode?
Thanks
 
Why don't you use this? See attached screenshot.
 

Attachments

  • Form icons.png
    Form icons.png
    13.8 KB · Views: 135
I use it. It was for a better customization. One icon to one form. But I think that 's not possible to customize more than this
 
Alright, I see. How does it show when it's tabbed? Let me see a screenshot.

Perhaps you need to add that code to the Got Focus event of the form.
 
It doesn't look like that's possible. If the form is a Popup form it works ok regardless of what the Tabbed Documents setting is.
 
I got an access 2003 based commercial software that does it. I wonder how... :((
 
2003 doesn't have the Tabbed Documents option, that was introduced in 2007. What I'm saying is that once a form or report is grouped as a tab the icon can't be any different from the application icon. As soon as it's not grouped, like having it as a popup, it can be changed.
 
Infact on popup modal form it works. But not on tabbed. I will go deeply in this question.
Anyway maybe the application I got is based on 2007. It has tabs
 
Infact on popup modal form it works. But not on tabbed.
That's precisely what I explained in the last two posts.

It would appear that Access changes the way it handles tabbed forms in this instance.
 
That's precisely what I explained in the last two posts.

It would appear that Access changes the way it handles tabbed forms in this instance.

Did anyone get this working in Tabbed Documents Access 2016 64Bit
 

Users who are viewing this thread

Back
Top Bottom