Fog Creek Software
Discussion Board

XP Themes and XP File Dialog

I have now finished (except for some documentation and some minor testing/debugging) an app I have been working on since early February

Currently I have about 5 or 6 outstanding bugs/limitations, the most annoying of which relate to running on XP.  The app is MFC, VC 6, but uses manifest file and on XP uses the new common dialogs (but also runs on Win95)

Two most annoying bugs:

1. This is very odd.  I set the current directory before showing the new (XP) or old (95, 98, NT4, etc) File Open dialog.

On XP, it appears to pick its only directory to open up in the dialog in (My Pictures) regardless of where te app sets the current folder.

Is this a known bug or feature in XP???

2. There are 3 toolbars in the app.  They all work, but 2 don't display right sometimes (and I can't see any obvious difference between them as all use same derived class of CToolbar).  There are 2 variables which affect the toolbars
(a) Whether XP UI enabled (Windows settings)
(b) Whether Manifest file is present

Toolbar 1 - shows bug if XP UI enabled, regardless of (b)
Toolbar 2 - always works
Toolbar 3 - shows bug if XP UI enabled, and if Manifest file present.

The bug is that the background color "leaks" behind the toolbar buttons (so the buttons appear on a gray square instead of the background of the buttons being the toolbar color)

Any guesses????

S. Tanna
Monday, June 23, 2003

If I understand your problem correctly:

For Bug 2:

Check the transparency color of the bitmap/gif used in Toolbar No. 2 and then compare that with the transparency color of the other Toolbars.  The transparency color has to be set in the bitmap/gif that you are displaying otherwise when the bitmap/gif is displayed you get the background color used in the bitmap/gif instead of the background color of the toolbar.  Hope that makes sense.

Dave B.
Monday, June 23, 2003

In other words, make sure the background color of the bitmaps used in the toolbar match the toolbar background color.

Dave B.
Monday, June 23, 2003

It makes sense, or would if the same bug appeared in other Windows versions (98 etc) - it doesn't

It almost seems like XP is playing around with the bitmap before it gets displayed

Toolbar 1 - image loaded with ImageList functions from a file
Toolbars 2+3 - image loaded from resources using LoadBitmap

S. Tanna
Monday, June 23, 2003

Re bug (1)

I had something like this happen when porting Lingo to XP. It was not caused by themes or the presence/absence of the .manifest file, it's just Microsoft changed something again in the OPENFILENAME structure.

(I just checked my notes since this happened a few months ago). I found that sometimes a NULL lpstrInitialDir does *not* cause the dialog to use the logged directory. Eg Windows XP sometimes looks in the "My documents" directory instead. The best solution was to make sure there was a Drive+Dir element (or use _getcwd) as lpstrInitialDir and use a Fname+Extn as lpstrFile. (lpstrInitialDir / lpstrFile are OPENFILENAME fields).

If you read closely through the up to date OPENFILENAME doco, there are comments that describe what Microsoft did to change it for XP.

Bill Rayer
Monday, June 23, 2003

*  Recent Topics

*  Fog Creek Home