私は現在、Windows GUI API を使用して作業しようとしていますが、さらに多くのことがわかります...要点を説明しましょう: 基本的に、msdnによるこのガイドに従って、Win7 の視覚スタイルを有効にしていますが、InitCommandcontrolsEx は false を返します: m 次のことを行います。
ヘッダーを含める
#include <windows.h>
#include <commctrl.h>
目的のビジュアル スタイルで初期化する
INITCOMMONCONTROLSEX icex;
icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
icex.dwICC = ICC_STANDARD_CLASSES;
if(InitCommonControlsEx(&icex)) {
cout << "Visual styles loaded" << endl;
} else {
cout << "Error while loading visual styles" << endl;
cout << GetLastError() << endl;
}
マニフェストをコンパイルするリソース ファイルを作成する
CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "GUI.exe.manifest"
マニフェスト自体
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="*"
name="Company.Project.Name"
type="win32"
/>
<description>Some Description.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type='win32'
name='Microsoft.Windows.Common-Controls'
version='6.0.0.0'
processorArchitecture='*'
publicKeyToken='6595b64144ccf1df'
language='*'
/>
</dependentAssembly>
</dependency>
</assembly>
そのために、GNU binutils の windres を使用しています
windres GUI.rc GUI.res
そして最後に、それと ComCtl32.dll に対してリンクします
g++ "-LC:\\Program Files\\Microsoft SDKs\\Windows\\v7.1\\Lib\\x64" -mwindows -o GUI.exe "src\\main.o" -lmingw32 -lComCtl32 "src\\GUI.res"
しかし、冒頭で述べたように、InitCommonControlsEx は常に false ブロックにジャンプし、false を証明する更新されたビジュアル スタイルを表示しません。何か案は?
システム: Win7 64Bit g++ コンパイル 64Bit IDE Eclipse CDT