Home > Back-end >  DEV - C how to use the new button style
DEV - C how to use the new button style

Time:10-03

This is the new button styles (VS or easy language can do), the mouse can have color change in the past, after click no focus:




This is the old version button style:




Excuse me in DEV - on how to use c + + to the new button style? Windows is a compiler and a feasible parameters, then how to do it on DEV - c + +?

CodePudding user response:

Windows is a compiler to add a parameter, but behind the scenes are doing these Settings

C language realization of XP style

Step 1:
In the project file new RC file "XPStyle manifest"
Content is as follows:

<? The XML version="1.0" encoding="utf-8" standalone="yes"?>


Type="win32"
Name="HTTP://Microsoft.Windows.Com mon - Controls,"
Version="6.0.0.0"
ProcessorArchitecture="x86"
B64144ccf1df publicKeyToken="6595", "
Language="*"/& gt;



-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
The following is a 64 - bit
<? The XML version="1.0" encoding="utf-8" standalone="yes"?>


Type="win32"
Name="HTTP://Microsoft.Windows.Com mon - Controls,"
Version="6.0.6000.0
"ProcessorArchitecture="amd64"
B64144ccf1df publicKeyToken="6595", "
Language="*"/& gt;




Step 2:
In the new project file RC resource file with
1 24 "XPStyle. Manifest"

Step 3:
Add the header file:
# include & lt; Commctrl. H>
And in the IDE project menu - & gt; Settings - & gt; The Link options page - & gt; Project Options to add comctl32. Lib library (because the default not add the library)
Or in the code to join
# pragma comment (lib, "comctl32. Lib")//for InitCommonControls

Step 4:
Call a function:
The InitCommonControls ();//XP style, otherwise call MessageBox will fail in a
  • Related