Tips & Tricks for EVC MFC PocketPC 2002

Remove the "OK" button ("X" will show instead) on dialog-based MFC apps:

Add this line to OnInitDialog():     SHDoneButton(m_hWnd, SHDB_HIDE);

Multiline text:

You should set Multiline flag in style and text in control should contain 'new line' symbols. For different controls you should use either \n or \r\n to divide lines. For button and edit controls use \r\n for all other control types use \n.
eg:  m_edit.SetWindowText(_T("Line one\r\nLine two")); 
see:  http://www.pocketpcdn.com/articles/multiline.html 

HTML Dialog with .png images:  HTML_Dialog

Add files "HTML_Dialog.cpp" and "HTML_Dialog.h" to your project
Under "Project Settings" and the "Link" tab, type "htmlview.lib" (including quotes) on the "Object/Library Modules" line
Add #include "HTML_Dialog.h" to the dialog or view .cpp file that will launch the html dialog window.
Add a new dialog resource and rename it to:  IDD_HTML_DIALOG. Delete the "OK" and "Cancel" buttons.
Create a new HTML resource and rename it to:  IDR_TestPage_HTML.  Create an HTML web page in your favorite editor and copy the text into this resource.
If your HTML file contains pictures, add them as "GIF" resources:  "Import" the picture into the resources and give it the type "GIF" (including the quotes).
Add a new menubar and call it IDR_HTML_MENUBAR1.  Add one item and give it the caption Tools.  Add two sub-items to Tools with IDs ID_FORCEFIT and ID_EDIT_COPY and captions Force Fit and Copy, respectively. 
Add the following code to launch the HTML dialog in response to, e.g., a button push on another dialog:
void CRayTestHTMLDlg::OnButton1() 
{//show the HTML dialog
    HTML_Dialog* pDlg=new HTML_Dialog;  //create the dialog
    pDlg->m_resID=IDR_TestPage_HTML;  //tell the dialog where the HTML text is located in resources
    pDlg->RegisterHtmlImage(IDR_GIF1,_T("rays_rpn8.png"));  //tell the dialog where images are located in resources
    pDlg->DoModal();  //show the window
}
You will need to modify the pDlg->RegisterHtmlImage(IDR_GIF1,_T("rays_rpn8.png")); line to reflect the name of the image in your HTML document.
Notes: 
HTML_Dialog is based, in part, on STHtmlDialog, which you can find here:  http://www.codeproject.com/ce/sthtmldialog.asp
You can also use other types of images, but .png are usually the most compressed.
The emulator may want to locate a bunch of ".dll" files to help with debugging but just close those windows. 
Download a sample project here.

Add color to your Dialog/View background, controls...

You need to handle the WM_CTLCOLOR message.  You may need to change the message filter to add it with ClassWizard See this page: http://www.experts-exchange.com/Programming/Programming_Languages/MFC/Q_21088854.html
 

Remove the "X" (smart-minimize) button from MFC apps:

add WS_NONAVDONEBUTTON to the window style
see:  http://www.pocketpcdn.com/articles/remove_x_button.html