Alt-tab icons 
Author Message
 Alt-tab icons

This is for use in VBA but hope the question is generic enough to ask here.

When a Userform is minimized (having added a minimize button on the form) it
shows in the taskbar. If the form has been given its own custom icon that
will show in the taskbar, otherwise with the icon of its parent application
(I'm using Excel).

To additionally make the minimized form appear in Alt-Tab list it seems need
to temporarily set its parent to the desktop (in the form's resize event)

SetWindowLong mFrmHwnd, GWL_HWNDPARENT, GetDesktopWindow
(when restored, in the resize event the parent is reset to Excel's window)

The minimized form now appears in the Alt-tab list, however its original
icon is replaced by the bland desktop icon (but still with original icon in
the taskbar).

So, how to have the form appear in the Alt-tab list with its own icon?

TIA,
Peter T



Sat, 10 Mar 2012 19:44:35 GMT  
 Alt-tab icons
How has the form been given its own custom icon?  If its like Access 2007
which allows you to choose a custom icon that's permiated through the
application then could it be that changing parent window to the desktop
would have an affect on the icon.  Or maybe you have set the small icon (the
16 x 16 one that appears in the title bar) and not the large icon (32 x 32?)
which I think is the one that appears in the Alt-tab list. Have you tried
sending a WM_SETICON message to mFrmHwnd?

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 IMAGE_ICON = 1
Public Const LR_LOADFROMFILE = &H10
Public Const WM_SETICON = &H80
Public Const ICON_SMALL = 0
Public Const ICON_BIG = 1

Dim hIcon As Long
hIcon = LoadImage(0&, strIconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE)
SendMessage mFrmHwnd, WM_SETICON, wParam, ByVal hIcon
'Use wParam 0 for small icon  wParam 1 for large icon (& 32,32 in the
LoadImage call if that's its size)

HTH

Jon


Quote:
> This is for use in VBA but hope the question is generic enough to ask
> here.

> When a Userform is minimized (having added a minimize button on the form)
> it shows in the taskbar. If the form has been given its own custom icon
> that will show in the taskbar, otherwise with the icon of its parent
> application (I'm using Excel).

> To additionally make the minimized form appear in Alt-Tab list it seems
> need to temporarily set its parent to the desktop (in the form's resize
> event)

> SetWindowLong mFrmHwnd, GWL_HWNDPARENT, GetDesktopWindow
> (when restored, in the resize event the parent is reset to Excel's window)

> The minimized form now appears in the Alt-tab list, however its original
> icon is replaced by the bland desktop icon (but still with original icon
> in the taskbar).

> So, how to have the form appear in the Alt-tab list with its own icon?

> TIA,
> Peter T



Sat, 10 Mar 2012 20:38:51 GMT  
 Alt-tab icons
I'm adding the icon pretty much as you describe, except the icon is taken
from an Image control on the form, having originally been assigned an icon
from file at design time.

hIcon = Me.appIcon.Picture
SendMessage mFrmHwnd, WM_SETICON, ICON_SMALL, ByVal hIcon
SendMessage mFrmHwnd, WM_SETICON, ICON_BIG, ByVal hIcon
DrawMenuBar mFrmHwnd

I don't think the issue is particularly the form's custom icon. If the
custom icon is omitted, the only difference is when the form is minimized it
will show an Excel icon in the taskbar but still the desktop icon in the
alt-tab list (because I've changed the form's parent to the desktop in order
to make it appear in the alt-tab list).

Thanks for your interest.

Regards,
Peter T


Quote:
> How has the form been given its own custom icon?  If its like Access 2007
> which allows you to choose a custom icon that's permiated through the
> application then could it be that changing parent window to the desktop
> would have an affect on the icon.  Or maybe you have set the small icon
> (the 16 x 16 one that appears in the title bar) and not the large icon (32
> x 32?) which I think is the one that appears in the Alt-tab list. Have you
> tried sending a WM_SETICON message to mFrmHwnd?

> 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 IMAGE_ICON = 1
> Public Const LR_LOADFROMFILE = &H10
> Public Const WM_SETICON = &H80
> Public Const ICON_SMALL = 0
> Public Const ICON_BIG = 1

> Dim hIcon As Long
> hIcon = LoadImage(0&, strIconPath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE)
> SendMessage mFrmHwnd, WM_SETICON, wParam, ByVal hIcon
> 'Use wParam 0 for small icon  wParam 1 for large icon (& 32,32 in the
> LoadImage call if that's its size)

> HTH

> Jon



>> This is for use in VBA but hope the question is generic enough to ask
>> here.

>> When a Userform is minimized (having added a minimize button on the form)
>> it shows in the taskbar. If the form has been given its own custom icon
>> that will show in the taskbar, otherwise with the icon of its parent
>> application (I'm using Excel).

>> To additionally make the minimized form appear in Alt-Tab list it seems
>> need to temporarily set its parent to the desktop (in the form's resize
>> event)

>> SetWindowLong mFrmHwnd, GWL_HWNDPARENT, GetDesktopWindow
>> (when restored, in the resize event the parent is reset to Excel's
>> window)

>> The minimized form now appears in the Alt-tab list, however its original
>> icon is replaced by the bland desktop icon (but still with original icon
>> in the taskbar).

>> So, how to have the form appear in the Alt-tab list with its own icon?

>> TIA,
>> Peter T



Sat, 10 Mar 2012 22:11:42 GMT  
 Alt-tab icons

Quote:

> To additionally make the minimized form appear in Alt-Tab list it seems need
> to temporarily set its parent to the desktop (in the form's resize event)

I don't believe that's the case.  A decade or more ago, I worked out the tests
ProgMan uses to determine what's in the AltTab order.  In a nutshell, this is them:

   Case tlAltTab
      ' Must be visible.
      If IsWindowVisible(hWnd) Then
         ' Can't have Parent.
         If GetParent(hWnd) = 0 Then
            ' Can't have Owner *except* in the case where
            ' owner has WS_EX_TOOLWINDOW StyleEx bit set.
            ' This is how VB apps (and others?) operate.
            hWndOwner = GetWindowLong(hWnd, GWL_HWNDPARENT)
            If (hWndOwner = 0) Or IsToolWindow(hWndOwner) Then
               ' Must not be Toolwindow.
               If Not IsToolWindow(hWnd) Then
                  ' We have a winner!
                  IsTask = True
               End If
            End If
         End If
      End If

Where:

   Private Function IsToolWindow(ByVal hWnd As Long) As Boolean
      ' Check for toolwindow style bit.
      IsToolWindow = ((GetWindowLong(hWnd, GWL_EXSTYLE) And WS_EX_TOOLWINDOW) =
WS_EX_TOOLWINDOW)
   End Function

Of course, that was back in the NT4 days.  It's interesting to hear, now, that these
tests may have been modified just a bit.  (Would be even more interesting to hear
whether the code I wrote -- http://vb.mvps.org/samples/AltTab -- "works" against
what you're seeing with your VBA form!)

Quote:
> SetWindowLong mFrmHwnd, GWL_HWNDPARENT, GetDesktopWindow
> (when restored, in the resize event the parent is reset to Excel's window)

> The minimized form now appears in the Alt-tab list, however its original
> icon is replaced by the bland desktop icon (but still with original icon in
> the taskbar).

> So, how to have the form appear in the Alt-tab list with its own icon?

My first suggestion would be to try setting the parent to 0& rather than the
Desktop, and see if that makes a difference.
--
.NET: It's About Trust!
 http://vfred.mvps.org


Sun, 11 Mar 2012 01:38:01 GMT  
 Alt-tab icons

"Karl E. Peterson" wrote

Quote:

>> To additionally make the minimized form appear in Alt-Tab list it seems
>> need
>> to temporarily set its parent to the desktop (in the form's resize event)

> I don't believe that's the case.

Well need to do proactively do something!

Quote:
>  It's interesting to hear, now, that these tests may have been modified
> just a bit.  (Would be even more interesting to hear whether the code I
> wrote -- http://vb.mvps.org/samples/AltTab -- "works" against what you're
> seeing with your VBA form!)

Your demo replicates what I see in Alt-tab, showing the same icon or no icon
depending on whether I changed the form's parent. Very nice!

Quote:
>> SetWindowLong mFrmHwnd, GWL_HWNDPARENT, GetDesktopWindow
>> (when restored, in the resize event the parent is reset to Excel's
>> window)

>> The minimized form now appears in the Alt-tab list, however its original
>> icon is replaced by the bland desktop icon (but still with original icon
>> in
>> the taskbar).

>> So, how to have the form appear in the Alt-tab list with its own icon?

> My first suggestion would be to try setting the parent to 0& rather than
> the Desktop, and see if that makes a difference.

Bingo!
I'm sure I tried with 0& before without effect, oh well.
All seems to be working fine now in W98se, XP & Vista.

Thank you,
Peter T



Sun, 11 Mar 2012 03:52:31 GMT  
 Alt-tab icons

Quote:

> "Karl E. Peterson" wrote

>>> To additionally make the minimized form appear in Alt-Tab list it seems need
>>> to temporarily set its parent to the desktop (in the form's resize event)

>> I don't believe that's the case.

> Well need to do proactively do something!

>>  It's interesting to hear, now, that these tests may have been modified
>> just a bit.  (Would be even more interesting to hear whether the code I
>> wrote -- http://vb.mvps.org/samples/AltTab -- "works" against what you're
>> seeing with your VBA form!)

> Your demo replicates what I see in Alt-tab, showing the same icon or no icon
> depending on whether I changed the form's parent. Very nice!

Whew!  That's certainly good to hear!  :-)

- Show quoted text -

Quote:
>>> SetWindowLong mFrmHwnd, GWL_HWNDPARENT, GetDesktopWindow
>>> (when restored, in the resize event the parent is reset to Excel's
>>> window)

>>> The minimized form now appears in the Alt-tab list, however its original
>>> icon is replaced by the bland desktop icon (but still with original icon
>>> in
>>> the taskbar).

>>> So, how to have the form appear in the Alt-tab list with its own icon?

>> My first suggestion would be to try setting the parent to 0& rather than
>> the Desktop, and see if that makes a difference.

> Bingo!
> I'm sure I tried with 0& before without effect, oh well.
> All seems to be working fine now in W98se, XP & Vista.

Hey, that's great!  I actually started wondering if this might be a topic worth
writing up?  Seems I've seen a number of questions lately about non-modal VBA forms,
and wonder if that's a growing trend.  Well, anyway, glad it got you going.
--
.NET: It's About Trust!
 http://vfred.mvps.org


Sun, 11 Mar 2012 05:30:21 GMT  
 Alt-tab icons

Quote:

>> Bingo!

> Hey, that's great!

It's the final piece in the jig-saw!

Quote:
> Seems I've seen a number of questions lately about non-modal VBA forms,
> and wonder if that's a growing trend.

Not sure if it's a growing trend but I guess use of modal / non-modal VBA
forms is pretty extensive; at least in app's like Excel & Word since
Office-2000 (VBA6) when the option to show modeless forms became available
(prior to that a somewhat kludgly API workaround was required).

Quote:
> I actually started wondering if this might be a topic worth writing up?

I'm intrigued! VBA is for all folks at all levels, but assuming the basic
concept of modality is understood there's not much to add. However, the VBA
userform still lacks many features taken for granted in VB6. Simple things
like being able to resize or minimize, add an icon etc require APIs which
tends to intimidate most users.

Stephen Bullen gives a great demo of what can be done with a userform, see
"FormFun.zip"
http://www.oaltd.co.uk/Excel/Default.htm

Not sure the example about minimizing the form & icon to the status bar is
the best way of going about it, seems a bit more than necessary. Also it
doesn't show how to put the form's icon in the alt-tab list (sorted that
here!).

There's plenty of scope for you to write up something useful and I wouldn't
be at all surprised if you come up with some more interesting fun things to
do <g>

Regards,
Peter T

PS if you want a simple VBA sample the to repro the alt-tab icon let me know
(and if to post here or off-line)



Sun, 11 Mar 2012 18:08:58 GMT  
 Alt-tab icons

Quote:


>>> Bingo!

>> Hey, that's great!

> It's the final piece in the jig-saw!

>> Seems I've seen a number of questions lately about non-modal VBA forms,
>> and wonder if that's a growing trend.

> Not sure if it's a growing trend but I guess use of modal / non-modal VBA
> forms is pretty extensive; at least in app's like Excel & Word since
> Office-2000 (VBA6) when the option to show modeless forms became available
> (prior to that a somewhat kludgly API workaround was required).

Yeah, seems I've seen more and more questions about adding min/max buttons, and so
on.

Quote:
>> I actually started wondering if this might be a topic worth writing up?

> I'm intrigued! VBA is for all folks at all levels, but assuming the basic
> concept of modality is understood there's not much to add. However, the VBA
> userform still lacks many features taken for granted in VB6. Simple things
> like being able to resize or minimize, add an icon etc require APIs which
> tends to intimidate most users.

> Stephen Bullen gives a great demo of what can be done with a userform, see
> "FormFun.zip"
> http://www.oaltd.co.uk/Excel/Default.htm

Cool.  That's a lot like what I did with http://vb.mvps.org/samples/FormBdr (I like
his name better!).  And, that's a lot like what I was thinking of moving over to
VBA.  Looks like he beat me to it.  I could see what of mine is still missing from
his, though, and add that.  Would be nice to have a single module that "did it all".

Quote:
> Not sure the example about minimizing the form & icon to the status bar is
> the best way of going about it, seems a bit more than necessary. Also it
> doesn't show how to put the form's icon in the alt-tab list (sorted that
> here!).

Adding an option to be in the AltTab order would be a good thing, no doubt.

Quote:
> There's plenty of scope for you to write up something useful and I wouldn't
> be at all surprised if you come up with some more interesting fun things to
> do <g>

I'll see if I think of much to add, thanks!

Quote:
> PS if you want a simple VBA sample the to repro the alt-tab icon let me know
> (and if to post here or off-line)

"All" you're doing is what Stephen's sample does to add the icon, then removing the
parent reference to Excel (while minimized), right?

Y'know what I was starting to play with, but didn't nail quickly enough before
getting a little bored and moving on to something else?  Sinking the UserForm's
native events in that support class without storing a hard reference to it.  That'd
be worth "putting out there" I think, because it'd let you take your strategy
entirely outside the form's code, other than to simply instantiate the class and
tell it what to do.
--
.NET: It's About Trust!
 http://vfred.mvps.org



Mon, 12 Mar 2012 08:37:56 GMT  
 Alt-tab icons

Quote:


>> Stephen Bullen gives a great demo of what can be done with a userform,
>> see
>> "FormFun.zip"
>> http://www.oaltd.co.uk/Excel/Default.htm

> Cool.  That's a lot like what I did with
> http://vb.mvps.org/samples/FormBdr (I like his name better!).  And, that's
> a lot like what I was thinking of moving over to VBA.  Looks like he beat
> me to it.  I could see what of mine is still missing from his, though, and
> add that.  Would be nice to have a single module that "did it all".

I've just had a quick look at yours, I definately need to have a longer
look! I think there are still some things missing in Stephen's. Eg, small
detail maybe you can answer here - when maximized an auto-hide taskbar is
not accesible.

Quote:
>> Not sure the example about minimizing the form & icon to the status bar
>> is
>> the best way of going about it, seems a bit more than necessary. Also it
>> doesn't show how to put the form's icon in the alt-tab list (sorted that
>> here!).

> Adding an option to be in the AltTab order would be a good thing, no
> doubt.

>> There's plenty of scope for you to write up something useful and I
>> wouldn't
>> be at all surprised if you come up with some more interesting fun things
>> to
>> do <g>

> I'll see if I think of much to add, thanks!
> "All" you're doing is what Stephen's sample does to add the icon, then
> removing the parent reference to Excel (while minimized), right?

Somewhat differently in one or two areas. Stephen's is geared up as a demo
so user can change things with those checkboxes. In practice most of form's
'styles' can be done in the Initialize event and stay that way. He uses
things like LockWindowUpdate & EnableWindow around SW_HIDE & SW_SHOW to
enable the form to go to the taskbar (instead of as a minimized floating
window), I use a different approach (to enable only). Actually I've only
just seen his recent 2005 update to do that, and I also see it's kind of
similar to yours!

Quote:
> Y'know what I was starting to play with, but didn't nail quickly enough
> before getting a little bored and moving on to something else?

Please don't lose interest - it'd be VBA-land's loss !!

Quote:
> Sinking the UserForm's native events in that support class without storing
> a hard reference to it.  That'd be worth "putting out there" I think,
> because it'd let you take your strategy entirely outside the form's code,
> other than to simply instantiate the class and tell it what to do.

That would certainly be worth doing if there are multiple similar forms to
deal with.

Regards,
Peter T



Mon, 12 Mar 2012 21:41:21 GMT  
 Alt-tab icons

Quote:



>>> Stephen Bullen gives a great demo of what can be done with a userform,
>>> see "FormFun.zip"
>>> http://www.oaltd.co.uk/Excel/Default.htm

>> Cool.  That's a lot like what I did with
>> http://vb.mvps.org/samples/FormBdr (I like his name better!).  And, that's
>> a lot like what I was thinking of moving over to VBA.  Looks like he beat
>> me to it.  I could see what of mine is still missing from his, though, and
>> add that.  Would be nice to have a single module that "did it all".

> I've just had a quick look at yours, I definately need to have a longer
> look! I think there are still some things missing in Stephen's. Eg, small
> detail maybe you can answer here - when maximized an auto-hide taskbar is
> not accesible.

I'm not following the question, I'm afraid?

Quote:
>> "All" you're doing is what Stephen's sample does to add the icon, then
>> removing the parent reference to Excel (while minimized), right?

> Somewhat differently in one or two areas. Stephen's is geared up as a demo
> so user can change things with those checkboxes. In practice most of form's
> 'styles' can be done in the Initialize event and stay that way.

Granted.

Quote:
> He uses
> things like LockWindowUpdate & EnableWindow around SW_HIDE & SW_SHOW to
> enable the form to go to the taskbar (instead of as a minimized floating
> window), I use a different approach (to enable only). Actually I've only
> just seen his recent 2005 update to do that, and I also see it's kind of
> similar to yours!

Hmmmm, well, if there's another way, I'd sure be interested in knowing what it was.
As I recall, it required toggling the window visibility to trigger the taskbar to
add the button, and LockWindowUpdate was simply to avoid the "flash" caused by that
toggle.

Quote:
>> Y'know what I was starting to play with, but didn't nail quickly enough
>> before getting a little bored and moving on to something else?

> Please don't lose interest - it'd be VBA-land's loss !!

Heh, oh, I always have 10 or 20 little projects like that floating around, hoping to
be "all grown up and ready to publish" someday.   :-)

Quote:
>> Sinking the UserForm's native events in that support class without storing
>> a hard reference to it.  That'd be worth "putting out there" I think,
>> because it'd let you take your strategy entirely outside the form's code,
>> other than to simply instantiate the class and tell it what to do.

> That would certainly be worth doing if there are multiple similar forms to
> deal with.

It's nice to be able to pull all the plumbing out of the (User)Form, and just set it
up in the support class, yeah.
--
.NET: It's About Trust!
 http://vfred.mvps.org


Tue, 13 Mar 2012 04:07:06 GMT  
 Alt-tab icons

Quote:


>> I think there are still some things missing in Stephen's. Eg, small
>> detail maybe you can answer here - when maximized an auto-hide taskbar is
>> not accesible.

> I'm not following the question, I'm afraid?

With a max button on the form, added as in Stephen's and similarly below,
when the form is maximized if occupies the entire screen, fine. Except if
you move the mouse to the bottom edge of the screen to activate the
'auto-hide' taskbar it doesn't appear. No problem doing similar with your
VB6 demo.

Quote:
>> He uses
>> things like LockWindowUpdate & EnableWindow around SW_HIDE & SW_SHOW to
>> enable the form to go to the taskbar (instead of as a minimized floating
>> window), I use a different approach (to enable only). Actually I've only
>> just seen his recent 2005 update to do that, and I also see it's kind of
>> similar to yours!

> Hmmmm, well, if there's another way, I'd sure be interested in knowing
> what it was. As I recall, it required toggling the window visibility to
> trigger the taskbar to add the button, and LockWindowUpdate was simply to
> avoid the "flash" caused by that toggle.

No doubt all that's required to toggle ability to minimize to the taskbar
on/off for demo purposes. However typically will never need to toggle off,
so this different approach seems to work -

' VBA Userform in Excel

Private Const WS_EX_DLGMODALFRAME As Long = &H1&
Private Const WS_EX_WINDOWEDGE As Long = &H100&
Private Const WS_EX_APPWINDOW As Long = &H40000
Private Const ws_ex_DAW = WS_EX_DLGMODALFRAME _
                Or WS_EX_WINDOWEDGE Or WS_EX_APPWINDOW

Private Sub UserForm_Activate()

   ' after the form has been shown to enable it to minimize to the taskbar
   SetWindowLong mFrmHwnd, GWL_EXSTYLE, ws_ex_DAW

End Sub

Private Sub UserForm_Initialize()
Dim nStyle As Long, hIcon As Long
Dim sIconFile As String

    mFrmHwnd = FindWindow("ThunderDFrame", Me.Caption)
    mAppHwnd = FindWindow("XLMAIN", Application.Caption)
    ' in XL10/2002 or later could do simply
    ' mAppHwnd = Application.hwnd

    ' the icon in a [hidden] image control on the form
    hIcon = Me.Image1.Picture

'    ' or get the icon from file
'    sIconFile = "C:\<path>\file.ico or .exe or  .dll"
'    hIcon = ExtractIcon(0&, sIconFile, 0&)

    ' add the custom icon
    SendMessage mFrmHwnd, WM_SETICON, ICON_SMALL, ByVal hIcon
    SendMessage mFrmHwnd, WM_SETICON, ICON_BIG, ByVal hIcon

    ' add the Minimize button  (and Max button if required)
    nStyle = GetWindowLong(mFrmHwnd, GWL_STYLE) Or WS_MINIMIZEBOX
    nStyle = nStyle Or WS_MAXIMIZEBOX
    SetWindowLong mFrmHwnd, GWL_STYLE, nStyle
    DrawMenuBar mFrmHwnd

End Sub

Private Sub UserForm_Resize()
    If IsIconic(mFrmHwnd) Then
        ' form has been minimized
        ' hide it as a 'floating' window and Minimize it to the taskbar
        ShowWindow mFrmHwnd, SW_HIDE
        ShowWindow mFrmHwnd, SW_MINIMIZE
        ' to put the form's icon in the Alt-Tab list
        SetWindowLong mFrmHwnd, GWL_HWNDPARENT, 0&
    Else
        If IsIconic(mAppHwnd) Then
            'Restore minimized Excel
            ShowWindow mAppHwnd, SW_RESTORE
        Else
            ' Activate Excel in case hidden behind other windows
            AppActivate (Application.Caption)
        End If
        ' Restore the form's parent as Excel
        SetWindowLong mFrmHwnd, GWL_HWNDPARENT, mAppHwnd
    End If
End Sub

Regards,
Peter T



Tue, 13 Mar 2012 17:20:41 GMT  
 Alt-tab icons
Peter T escribi:

Quote:


>>> I think there are still some things missing in Stephen's. Eg, small
>>> detail maybe you can answer here - when maximized an auto-hide taskbar is
>>> not accesible.
>> I'm not following the question, I'm afraid?

> With a max button on the form, added as in Stephen's and similarly below,
> when the form is maximized if occupies the entire screen, fine. Except if
> you move the mouse to the bottom edge of the screen to activate the
> 'auto-hide' taskbar it doesn't appear. No problem doing similar with your
> VB6 demo.

If you first set sizable, and then maximize button (in this order), it
works.


Wed, 14 Mar 2012 13:39:23 GMT  
 Alt-tab icons

Quote:

> Peter T escribi:


>>>> I think there are still some things missing in Stephen's. Eg, small
>>>> detail maybe you can answer here - when maximized an auto-hide taskbar
>>>> is
>>>> not accesible.
>>> I'm not following the question, I'm afraid?

>> With a max button on the form, added as in Stephen's and similarly below,
>> when the form is maximized if occupies the entire screen, fine. Except if
>> you move the mouse to the bottom edge of the screen to activate the
>> 'auto-hide' taskbar it doesn't appear. No problem doing similar with your
>> VB6 demo.

> If you first set sizable, and then maximize button (in this order), it
> works.

AhHa! Looks like sizable can be set any time, even after the form has been
maximized -

Private Sub UserForm_Click()
Dim nStyle As Long
    nStyle = GetWindowLong(mFrmHwnd, GWL_STYLE) Or WS_THICKFRAME
    SetWindowLong mFrmHwnd, GWL_STYLE, nStyle
    DrawMenuBar mFrmHwnd
End Sub

With the code I posted previously, if I manually maximize the form, the
auto-hide taskbar is not accessible. If I click the form I can now get the
taskbar. (Not that I would ever arrange it that way).

Thank you!
Peter T



Wed, 14 Mar 2012 19:44:58 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. NotifyIcon and Alt+Tab Icon

2. Taskbar, Alt-Tab Icon Disappearing Act

3. Alt+Tab Icon missing

4. Changing the ALT+TAB icon

5. how to set Alt+Tab icon?

6. ALT-TAB Icon - How do I set it?

7. Change AltTab icon at run time

8. Cancel Alt + Tab / Cancelar Alt + Tab

9. How do you change the Alt-Tab icon at run time ?

10. Problem with Icon in ALT+TAB Window.

11. Hide icon on ALT+TAB?

12. Icon drawing from resource editor won't show in Alt-Tab window

 

 
Powered by phpBB® Forum Software