🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #1544

My Unicode combobox has problems with its XP/Vista visual appearance

#1544
From: Kris
Date: Tue, 31 Jul 2007 17:44
56 lines
2439 bytes
Hi,

Using the small piece of code below I create a combobox capable of 
displaying Unicode. Everything works just great except for a few details 
of the visual appearance of the box. Compared to a regular XP/Vista 
themed TComboBox I can see following differences:

+ XP/Vista: When opening the drop down list and moving over the 
available items no blue selection bar (which is as wide as the combobox) 
will follow the mouse cursor when moving over the items in the drop down 
list.
+ Vista: A combobox with its drop down list not active will show 
incorrect background colour.

TXPManifest is present on the form and does indeed takes care of most of 
the theming for the unicode combo, but a few details are missing when 
compared to a regular VCL TCombobox.

Any suggestions are much appreciated,

Kris

HWND hwndCB;
INITCOMMONCONTROLSEX icex;

icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_USEREX_CLASSES;

InitCommonControlsEx(&icex);

hwndCB=CreateWindowW(
			WC_COMBOBOXEXW,
			NULL,
			WS_BORDER | WS_VISIBLE |
			WS_CHILD | CBS_DROPDOWNLIST,
			80,
			80,
			0,
			100,
			Handle,
			NULL,
			Form1,
			NULL
		);
		
COMBOBOXEXITEMW ComboItemW;
memset(&ComboItemW,0,sizeof(ComboItemW));

ComboItemW.pszText=MyWideString;
ComboItemW.mask = CBEIF_TEXT;
ComboItemW.iItem=0;

SendMessage(hwndCB,CBEM_INSERTITEMW,-1,(LPARAM)&ComboItemW);
SendMessage(hwndCB,CBEM_INSERTITEMW,-1,(LPARAM)&ComboItemW);

SetWindowPos(hwndCB,NULL,80,80,250,120,SWP_NOACTIVATE);
Technical Details
Message-ID: <46af7501@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,385ec0e9c415aa41,start
X-Google-Attributes: gid10cc67,public,usenet
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 31 Jul 2007 19:44:39 +0200
From: Kris <ks@ks.com>
User-Agent: Thunderbird 2.0.0.5 (Windows/20070716)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: My Unicode combobox has problems with its XP/Vista visual appearance
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 83.134.82.222
Message-ID: <46af7501@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1185903873 83.134.82.222 (31 Jul 2007 10:44:33 -0700)
Lines: 56
Path: arc1-ca.pugleaf.net!g2news2.google.com!news2.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!newspeer1.nwr.nac.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
X-Original-Bytes: 2283