Yes I had, but I just went back and tried again (I initially missed the second step). I've added this incantation to the Windows application manifest:
...
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
...
...
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
...
To copy to clipboard, switch view to plain text mode
and this snippet at the front of the application main
INITCOMMONCONTROLSEX iccex;
iccex.dwSize = sizeof(iccex);
iccex.dwICC = ICC_STANDARD_CLASSES;
BOOL ret = ::InitCommonControlsEx(&iccex);
if (ret != 0)
qDebug() << "::InitCommonControlsEx() success";
INITCOMMONCONTROLSEX iccex;
iccex.dwSize = sizeof(iccex);
iccex.dwICC = ICC_STANDARD_CLASSES;
BOOL ret = ::InitCommonControlsEx(&iccex);
if (ret != 0)
qDebug() << "::InitCommonControlsEx() success";
To copy to clipboard, switch view to plain text mode
and this in the constructor for the form:
static const UINT BCM_SETSHIELD = 0x160C; //Elevated button
WId id = widget->winId();
(void) ::SendMessage(id, BCM_SETSHIELD, 0, TRUE);
}
static const UINT BCM_SETSHIELD = 0x160C; //Elevated button
WId id = widget->winId();
(void) ::SendMessage(id, BCM_SETSHIELD, 0, TRUE);
}
To copy to clipboard, switch view to plain text mode
and still no shield icon (Win7). I am guessing that Qt is drawing the control without reference to Windows; but it just a guess.
At the moment it looks like my best option is to load the shield icon resource from the Windows file that contains it and try to get it into a QIcon (via a QPixmap perhaps). Haven't the time to try this right now though.
Bookmarks