Failure to load icon causes UserForm to minimize to bogus object inworksheet area.

B

baobob

All:

I wish to report fixing a bug of my creation, whose diagnosis was
unbelievably difficult because its symptoms were so screwy. In the
process, maybe I can save someone from doing what I did.

A couple of years ago, I reported about a VBA application I wrote:

http://groups.google.com/group/micr...k=gst&q=icon+minimize+bullen#f49c39ac331e8250

using Stephen Bullen's tremendous CFormChanger:

www.oaltd.co.uk

and with extensive help from Peter T. of this group.

Often, after launching my app a number of times during the same Excel
session, for no apparent reason, 1) my graphic icon for the app
disappeared from the U.L. corner of the UserForm, next to the app's
caption, 2) it also disappeared from Windows' Alt-TAB context-
switching 'carousel', and 3) most maddening of all, the UserForm,
whenever I minimized it, remained visible as a little, long, skinny,
gray, iconized, button-like thingy, still having the stupid Min/
Restore/Max buttons on it. Worst of all, Windows was parking this
wretched thing in the L.L. corner of my worksheet space, where in my
opinion system-overhead crap which doesn't have focus or modality has
no right to appear.

One of you also told me that, evidently for backward compatibility
reasons, when you minimize a Windows app, Microsoft doesn't actually
hide it. Instead, they reposition it in some kind of hyperspace, e.g.
at 3000, 3000, or some such galaxy a long time ago, far, far away.
That's fine. I assumed, altho' I don't know, that the thingy I was
seeing might be this artifact, appearing in my space for some reason.

At the same time, all along, the app's normal Taskbar icon was
appearing on the Taskbar fine, whether the app was maximized or
minimized.

In any event, come to find out, it was programmer error. I thought I
was telling the app where to find its .ico file on launch. Instead,
under certain conditions, it was was simply going to the current user-
selected directory. After fixing it so the app always finds the .ico
file on launch, everything works fine: The icon is always there (both
on the form and in Alt-TAB), and the app minimizes correctly--namely,
the standard Taskbar icon is still there, and no bogus button
artifact.

My only question is: Why should failure to load an app's icon change
its minimize behavior? Perhaps someone can explain that. Then again,
I suppose it could be another programmer error.

Thanks.

***
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top