TabControl Bug in Find Files dialog

English support forum

Moderators: white, Hacker, petermad, Stefan2

Post Reply
EvilCracker
Junior Member
Junior Member
Posts: 7
Joined: 2005-01-22, 18:20 UTC

TabControl Bug in Find Files dialog

Post by *EvilCracker »

I would like to talk to the author about a bug...
Hello,
I noticed a bug in Find Files dialog. When using XP-style theme in application, dialogs on TabControl has old color, like xp-style is not enabled. (Press Alt+F7 in total commander and you will see white tabs and old-styled color of tabcontrol contents). It seems it's a bug of Windows developers. I spent much time fixing it in my programs but I found a solution. I fix it by manual executing EnableThemeDialogTexture function.
Here is a part of code from my MFC program:

Code: Select all

//Checking if application is able to use XP-style

 HMODULE hinstDll; 
 bool XPStyle = false; 
 HRESULT (__stdcall  *pEnableThemeDialogTexture)(HWND hwnd, DWORD dwFlags); 
 bool (__stdcall *pIsAppThemed)(); 

 hinstDll = ::LoadLibrary("UxTheme.dll"); 
 if (hinstDll) 
 { 
  (FARPROC&)pIsAppThemed = ::GetProcAddress(hinstDll, "IsAppThemed"); 
  (FARPROC&)pEnableThemeDialogTexture = ::GetProcAddress(hinstDll, "EnableThemeDialogTexture"); 
  ::FreeLibrary(hinstDll); 
  if (pIsAppThemed != NULL && pEnableThemeDialogTexture!= NULL) XPStyle = pIsAppThemed(); 
 } 

// ....

// Executing EnableThemeDialogTexture() for a dialog inside TabControl and showing a dialog
if (XPStyle) pEnableThemeDialogTexture(TabControl->MyDlg->m_hWnd, ETDT_USETABTEXTURE|ETDT_ENABLETAB); 
 TabControl->MyDlg->ShowWindow(SW_SHOW);
Hope it helps and we will see a nice Find Files window in next version! =)
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for your code! I will try it out in Find files. I didn't even notice that anything could be wrong...
Author of Total Commander
https://www.ghisler.com
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

This may be related, under Win2K - TC 6.53
When you change your desktop theme - specifically the 3D colour - the background of the main toolbar and the tabs retains the old 3D colour.

Of course it's not an unpleasant bug - it produces an interesting appearance...I've come to consider it (as Microsoft likes to say) an intended feature ;)
*BLINK* TC9 Added WM_COPYDATA and WM_USER queries for scripting.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2Balderstrom
The buttonbar (and probably the tab control) doesn't react to the system event for speed reasons.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48088
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

It reacts to it only delayed, on the next manual button bar change, or when you restart Total Commander. The reason is that re-building the bar is quite slow, especially when a virus scanner slows down the extraction of the icons from EXE files.
Author of Total Commander
https://www.ghisler.com
Post Reply