Modifystyle function usage
1.
Function
: Call this member function to modify a window's style.
2.
Function prototype
:
Bool modifystyle
(
DWORD dwremove,
DWORD dwadd,
Uint
Nflags
);
3.
Parameter description
:
Dwremove
Specify the extended attributes to be deleted,
Dwadd
Specify the extended attributes to be added when modifying,
Nflag
Flag is generally set
0
.
4
Usage
:
1
, Used to modify the original properties of the control
Modifystyle (1, ws_disabled );(
For actual testing
>
=
0
The integer number is enough.
)
2
And use it if it is changed back.
Modifystyle (ws_disabled, 1 );(
For actual testing
>
=
0
The integer number is enough.
)
If you think of a parameter as a Boolean value, use
1
To remove the property of the nth control, let the first parameter
Dwremove
True: The second parameter is set after modification.
Dwadd
True
.
5.
Reference Code
:
Cbutton * pbtn = NULL;
Pbtn = (cbutton *) getdlgitem (idc_btn_browsefolder );
Pbtn-> modifystyle (1, ws_disabled );
Pbtn-> invalidate (false );
6.
Other Instructions
:
1
Modifystyle
Description of style parameters in
:
Es
Start
Editbox es
(
Edit Style
Abbreviations, others are similar)
BS
Start
Button
LVS
Start
Listview
WS
Starting
Windows
Universal control style
For an extended style, add
Ex,
For example
Ws_ex_clientedge
2
Bool modifystyleex (
DWORD dwremove,
DWORD dwadd,
Uint nflags = 0
);
Ss_policy sends the parent window stn_clicked,
Stn_dblclk, stn_disable, and stn_enable notification messages
When the user clicks or double-clicks the control.
Modifystyle (ss_notify, 0); // remove
Modifystyle (0, ss_policy); // Add