What happens before and after OnInitDialog!

Two functions to look up would be… _AfxPreInitDialog _AfxPostInitDialog As the name suggests _AfxPreInitDialog gets called before OnInitDialog is called and _AfxPostInitDialog gets called after OnInitDialog. One of the things that happens in _AfxPostInitDialog is centering of a dialog if user hasn’t changed position of the dialog in OnInitDialog, so how is this done? _AfxPreInitDialog […]
Continue reading…

 

Making a property sheet window resizable!

Sometime back my boss asked me to write a test application for a layout manager. This test application was for testing layout manager on a property sheet! Hmm so property sheet cannot be resized even if you modify the style of a property sheet. Well the reason why it can’t be resized is because SC_SIZE […]
Continue reading…

 

Changing the tab order of a control at runtime!

Follow these steps(Just a demo)… Add two buttons to a fresh dialog in a sequencial order, IDC_BUTTON1 and IDC_BUTTON2 Goto OnInitDialog(you are not restricted to OnInitDialog, you can also do this on a button click) and paste this line of code [sourcecode language=’cpp’]GetDlgItem( IDC_BUTTON1 )->SetWindowPos(GetDlgItem( IDC_BUTTON2 ), 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | […]
Continue reading…