Click here to Skip to main content
15,902,445 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Toolbar bug? Pin
Deian13-May-04 8:53
Deian13-May-04 8:53 
GeneralRe: Toolbar bug? Pin
toxcct13-May-04 8:59
toxcct13-May-04 8:59 
GeneralRe: Toolbar bug? Pin
Deian13-May-04 9:33
Deian13-May-04 9:33 
AnswerRe: Toolbar bug? Pin
vividtang13-May-04 22:04
vividtang13-May-04 22:04 
GeneralRe: Toolbar bug? Pin
Deian14-May-04 4:44
Deian14-May-04 4:44 
GeneralWindowless activex controls in CDialogs... Pin
Neo20513-May-04 6:52
Neo20513-May-04 6:52 
GeneralOnParentNotify (related to WM_RButtonDown) Pin
doctorpi13-May-04 6:05
doctorpi13-May-04 6:05 
GeneralRe: OnParentNotify (related to WM_RButtonDown) Pin
Antti Keskinen13-May-04 7:22
Antti Keskinen13-May-04 7:22 
This requires basic knowledge of binary operations, AND, OR, XOR and one's complement.

To remove the WS_EX_NOPARENTNOTIFY style, you must specify a DWORD containing all the extended styles you want for your child control, then passing the DWORD as the first parameter of CreateEx() call. For a list of extended styles, either read them from the 'winuser.h' file in the Platform SDK, or visit MSDN in this link.

Alternatively, you can create the control, then request for it's extended styles through GetWindowLong( hwnd, GWL_EXSTYLE ) (Win32) or CWnd::GetExStyle (MFC). Both will return the DWORD of the extended style bit field. You can then use any operations in the following list to change the styles:

To toggle a flag (if enabled -> disable, if disabled -> enable), use exclusive-OR as in dwExStyle ^= WS_EX_NOPARENTNOTIFY.
To always disable a style flag, use AND and one's complement as in dwExStyle &= ~WS_EX_NOPARENTNOTIFY.
To always enable a style flag, use inclusive-OR as in dwExStyle |= WS_EX_NOPARENTNOTIFY.

Probably the 'AND and one's complement' requires a bit more clarification ?

Well, first, one's complement is an operation that inverts a bit sequence. Consider a sequence called '00010000'. Using one's complement on this would result '11101111'. Basically, all 1's become 0's and vice versa. Now, the WS_EX_NOPARENTNOTIFY is precisely a sequence like this: lots of zeros, and a single 1 somewhere. Using one's complement on it will result an inverse bit sequence (lots of 1's and a single zero somewhere).

If you AND this with the original style flag, the original bit field (style flag) will dictate the result for every other flag EXCEPT for the WS_EX_NOPARENTNOTIFY. As the second operand (one's complement of WS_EX_NOPARENTNOTIFY) of the AND operation has a 0 there, the result will always be 0 for that flag, no matter what the original bit field's value was. All other flags in the field are left as they were. If they were 0, they remain 0, if they were 1, they remain 1. This happens because the second operand has all other bits as 1's.

Hope this will help.

-Antti Keskinen

----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
GeneralRe: OnParentNotify (related to WM_RButtonDown) Pin
doctorpi13-May-04 7:28
doctorpi13-May-04 7:28 
GeneralRe: OnParentNotify (related to WM_RButtonDown) Pin
Antti Keskinen13-May-04 10:57
Antti Keskinen13-May-04 10:57 
GeneralwaveInPrepareHeader increases handle Pin
13-May-04 5:14
suss13-May-04 5:14 
GeneralRe: waveInPrepareHeader increases handle Pin
bikram singh13-May-04 5:31
bikram singh13-May-04 5:31 
GeneralRe: waveInPrepareHeader increases handle Pin
huaiyeu13-May-04 5:36
huaiyeu13-May-04 5:36 
GeneralRe: waveInPrepareHeader increases handle Pin
Joe Woodbury13-May-04 8:59
professionalJoe Woodbury13-May-04 8:59 
GeneralRe: waveInPrepareHeader increases handle Pin
13-May-04 10:38
suss13-May-04 10:38 
GeneralRbuttonDown and OnCommand Pin
doctorpi13-May-04 4:58
doctorpi13-May-04 4:58 
GeneralRe: RbuttonDown and OnCommand Pin
toxcct13-May-04 5:19
toxcct13-May-04 5:19 
GeneralRe: RbuttonDown and OnCommand Pin
doctorpi13-May-04 5:22
doctorpi13-May-04 5:22 
GeneralRe: RbuttonDown and OnCommand Pin
toxcct13-May-04 5:27
toxcct13-May-04 5:27 
GeneralRe: RbuttonDown and OnCommand Pin
doctorpi13-May-04 5:34
doctorpi13-May-04 5:34 
GeneralRe: RbuttonDown and OnCommand Pin
David Crow13-May-04 6:39
David Crow13-May-04 6:39 
GeneralRe: RbuttonDown and OnCommand Pin
doctorpi13-May-04 7:03
doctorpi13-May-04 7:03 
GeneralRe: RbuttonDown and OnCommand Pin
David Crow13-May-04 6:55
David Crow13-May-04 6:55 
GeneralRe: RbuttonDown and OnCommand Pin
doctorpi13-May-04 7:22
doctorpi13-May-04 7:22 
GeneralRe: RbuttonDown and OnCommand Pin
David Crow13-May-04 9:18
David Crow13-May-04 9:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.