I couldn't recreate the problem. I started a VS2003 dialog app, put a
combobox on it, set ownerdraw variable, and has string flags on it. Added a
strings to the combobox. Ran the program both on an xp and vista machine,
and on both when I dropped down the list the first item was highlighted.
AliR.
"AliR [VC++ MVP]" <AliR@online.nospam> wrote in message
news:u3CCBpd6JHA.5828@TK2MSFTNGP04.phx.gbl...
I don't know how to add Vista styles to an application. If you can send
me a link on how to do that, or send me your project, I might be able to
help you out on that.
I'm using VC++ 2003 at the moment, but the procedure should be the same
for later versions.
It's just a matter of adding a Common Control Manifest to the project.
Actually I wasn't exactly sure how to do that so I created a new project
from scratch and selected the Common Controls setting in the wizard. It
should also add the following lines to the InitInstance() method:
// InitCommonControls() is required on Windows XP if an application
// manifest specifies use of ComCtl32.dll version 6 or later to enable
// visual styles. Otherwise, any window creation will fail.
InitCommonControls();
I then pulled in the source files from the Codeproject sample.
I also had to do the following:
1. Edit the .rc file which will have a line for the manifest, but it has
an #ifdet _UNICODE around it. If not using UNICODE you need to remove the
#ifdef surrounding it
2. MS Sans Serif will be used in the windows which looks poor. To use the
newer UI fonts, edit the .rc file and replace the
FONT 8, "MS Sans Serif"
with
FONT 8, "MS Shell Dlg", 0, 0, 0x1
but you may not need to do the above in later versions of VC++.
I can send you project files which would demonstate the problem, but you
have a nospam email address.