[TRY 3] Add support for tooltips for system tray icons

Kuba Ober kuba at mareimbrium.org
Thu Aug 31 14:01:39 CDT 2006


> > Shouldn't you only initialize comctl32 once, rather than every time
> > there's no icons and we add one?
>
> Sure. I did it like this because Alexandre only wanted to have common
> controls initialized when we added an icon so we didn't have to do so
> much work at explorer startup. Taking a second look I see how we could
> end up initializing common controls more than once. My first thought on
> this is to add a boolean variable somewhere that would tell us if we've
> already initialized comctl32 so we don't do it more than once.

What about a static variable right in the function where you call the 
initialization function? That'd work fine if you don't call 
InitCommonControlsEx from anywhere else:

if (!list_head(&tray.icons))
{
	static BOOL controls_initialized = FALSE;
	INITCOMMONCONTROLSEX init_tooltip;

	init_tooltip.dwSize = sizeof(INITCOMMONCONTROLSEX);
	init_tooltip.dwICC = ICC_TAB_CLASSES;

	if (! controls_initialized) {
		InitCommonControlsEx(&init_tooltip);
		controls_initialized = TRUE;
	}
	. . .
}

Cheers, Kuba



More information about the wine-devel mailing list