How to find the STATIC controls on a form |
Post Reply |
Author | |
TrevorS
Newbie Joined: 09 December 2008 Location: Canada Status: Offline Points: 2 |
Post Options
Thanks(0)
Posted: 09 December 2008 at 8:22am |
I would like to find all of the static controls on a form view.
I want to disable all controls except the statics (to prevent accidental edits until the user has confirmed that they intend to edit).
I can't see a way to get at cs.lpszClass.
And the "un-attached" CWnd has a runtime class of CWnd, so I can't test the actual RUNTIME CLASS.
Unless I know the class, I don't think I can reliably test the style masks either?
Is there an easy way to do this?
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Use GetClassName:
TCHAR szClassName[10]; {
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
TrevorS
Newbie Joined: 09 December 2008 Location: Canada Status: Offline Points: 2 |
Post Options
Thanks(0)
|
Thanks. I discovered that after I posted here.
I still didn't find masks for filtering all of the styles. For example BS_PUSHBUTTON is 0. I can't use this technique for a value of zero.
|
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Yes, BS_PUSHBUTTON is 0.
if( (pWnd->GetStyle() & 0xF) == BS_GROUPBOX ) ...
if( (pWnd->GetStyle() & 0xF) == BS_PUSHBUTTON) etc.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |