Creating a dialog from it’s template!

Here is a sample on how to do it… [sourcecode language=’cpp’]CDialogTemplate dlgTemplate; // Load dialog template into memory dlgTemplate.Load( MAKEINTRESOURCE( IDD_DIALOG_ID )); // Change font of dialog dlgTempl.SetFont( _T( “Courier” ), 10 ); // Creates and displays a modal dialog from a template in memory CDialog dlg; dlg.InitModalIndirect( dlgTemplate.m_hTemplate, 0 ); dlg.DoModal();[/sourcecode] What’s the use […]
Continue reading…

 

A MessageBox with your own icon, wow!!

Windows API provides a messagebox function called MessageBoxIndirect. It takes a MSGBOXPARAMS structure pointer as parameter which contains necessary information to display a dialog box. Here is the code… [sourcecode language=’cpp’]// Custom message box function static int CustomMsgBox( LPCTSTR lpctszMessage_i,                          LPCTSTR lpctszTitle_i,                          UINT uFlags,                          HWND hWndParent_i = 0,                         LPCTSTR lpctszIconResource_i = […]
Continue reading…