本文介绍了windows 7样式的combobox在internet explorer工具栏,如何?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个Internet Explorer工具栏,我要放置一个在我的工具栏上创建的组合框

  HWND combobox1 = CreateWindow(_T(COMBOBOX),_T(combobox),WS_BORDER | 
WS_VISIBLE | WS_CHILD | CBS_DROPDOWN,10,0,200,
250,m_hWnd,(HMENU) NULL,NULL,NULL);

这个方法可以正常工作,但是combobox是以Windows Classic方式设计的,它使用Windows Aero主题。我试过这个:

  #pragma comment(linker,\/ manifestdependency:type ='win32'name = 'microsoft.Windows.Common-Controls'version ='6.0.0.0'processorArchitecture ='*'publicKeyToken ='6595b64144ccf1df'language ='*'\)`
pre>



但没有什么改变。 (我试过这个简单的Win32应用程序和风格工作正常,但在工具栏上的DLL上的风格没有得到设置)



解决方案

将comctl32清单添加到加载到另一个进程的DLL不会影响由EXE建立的默认激活上下文。



,你的DLL将需要激活它的激活上下文,当它被调用。请参见CreateActCtx,ActivateActCtx。



这是一个廉价/快速的方法是ISOLATION_AWARE_ENABLED。



Martyn


I'm developing an Internet Explorer toolbar and I want to place a combobox I create on my toolbar.

HWND combobox1=CreateWindow(_T("COMBOBOX"), _T("combobox"), WS_BORDER |
        WS_VISIBLE | WS_CHILD | CBS_DROPDOWN, 10, 0, 200,
        250, m_hWnd, (HMENU) NULL,NULL , NULL);

And that works correctly, but the combobox is styled in the Windows Classic way, and I want to have it use the Windows Aero theme. I've tried this:

#pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")`

But nothing changes. (I tried this on a simple Win32 app and the style worked fine, but in the DLL on the toolbar the style doesn't get set)

Here's a simple example.

解决方案

Adding a comctl32 manifest to a DLL loaded into another process doesn't impact the default activiation context that was established by the EXE.

Instead, your DLL will need to activate it's activation context when it is called. See CreateActCtx, ActivateActCtx. You will then DeactivateActCtx in each method before you return to IE and ReleaseActCtx when you shut down.

A cheap/quick way of doing this is ISOLATION_AWARE_ENABLED.

Martyn

这篇关于windows 7样式的combobox在internet explorer工具栏,如何?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-16 03:51