Microsoft KB Archive/308593

= How To Create Pocket PC-Style Property Sheets Using Win32 API =

Article ID: 308593

Article Last Modified on 9/7/2004

-

APPLIES TO


 * Microsoft Windows CE Palm-size PC 2.01 software

-



This article was previously published under Q308593



SUMMARY
The Pocket PC Control Panel and MFC Pocket PC AppWizard applications have property sheets that are flat and have the tabs at the bottom. By default, the Win32 PropertySheet API creates property sheets that have a 3-D look and have the tabs on top. This article describes how to make property sheets that are created with the Win32 PropertySheet API look like those of the Pocket PC Control Panel and MFC Pocket PC AppWizard applications.



MORE INFORMATION
  Create the property sheet with the PSH_MAXIMIZE flag: void ShowPropSheet(HWND hWnd) { ...  pshPropSheet.dwSize = sizeof(PROPSHEETHEADERW); pshPropSheet.dwFlags = PSH_USECALLBACK | PSH_MAXIMIZE; pshPropSheet.hwndParent = hWnd; pshPropSheet.hInstance = hInst; pshPropSheet.pszCaption = NULL; pshPropSheet.phpage = hphPage; pshPropSheet.nPages = 2; pshPropSheet.nStartPage = 1; pshPropSheet.pfnCallback = (PFNPROPSHEETCALLBACK) PropSheetProc;

if (-1 == PropertySheet(&pshPropSheet)) {   ...  } }                      Handle the PSCB_GETVERSION message in the property sheet callback procedure to return COMCTL32_VERSION: int CALLBACK PropSheetProc(HWND hwndDlg,UINT uMsg,LPARAM lParam) { ...  switch (uMsg) {   ...

case PSCB_GETVERSION: return COMCTL32_VERSION;

default: break; } return 0; }

By returning this value, you are telling the system to use the visual style for the tab control that is associated with newer versions of the control. 

NOTE: The Pocket PC documentation page for PropSheetProc incorrectly states a return type of void. However, the prsht.h header declares the function with a return type of int so the function definition for PropSheetProc shown in this section is correct.

Additional query words: propertypage page

Keywords: kbhowto KB308593

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.