GetDlgItem fails for an ActiveX control

Was working with a customer yesterday who was having this issue of GetDlgItem failing to return a valid window handle for an ActiveX control placed on a dialog. The ActiveX control is visible though but curiously the handle was always showing up as NULL. While debugging saw this particular line in the Visual Studio 2010 […]
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…