Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.3 KiB

  1. /*++
  2. Copyright (c) 1999 Microsoft Corporation
  3. Module Name:
  4. pos.c
  5. Abstract: Control Panel Applet for OLE POS Devices
  6. Author:
  7. Karan Mehra [t-karanm]
  8. Environment:
  9. Win32 mode
  10. Revision History:
  11. --*/
  12. #include "pos.h"
  13. VOID OpenPOSPropertySheet(HWND hwndCPl)
  14. {
  15. static HANDLE hMutex;
  16. HPROPSHEETPAGE rPages[MAX_CPL_PAGES];
  17. PROPSHEETPAGE psp;
  18. PROPSHEETHEADER psh;
  19. hMutex = CreateMutex(NULL, TRUE, MUTEX_NAME);
  20. if(GetLastError() == ERROR_ALREADY_EXISTS)
  21. return;
  22. psh.dwSize = sizeof(PROPSHEETHEADER);
  23. psh.dwFlags = PSH_NOAPPLYNOW | PSH_USEICONID;
  24. psh.hwndParent = hwndCPl;
  25. psh.hInstance = ghInstance;
  26. psh.pszCaption = MAKEINTRESOURCE(IDS_POS_NAME);
  27. psh.pszIcon = MAKEINTRESOURCE(IDI_POS);
  28. psh.nPages = 0;
  29. psh.nStartPage = 0;
  30. psh.phpage = rPages;
  31. /*
  32. * The Devices Tab
  33. */
  34. psp.dwSize = sizeof(PROPSHEETPAGE);
  35. psp.dwFlags = PSP_DEFAULT;
  36. psp.hInstance = ghInstance;
  37. psp.pszTemplate = MAKEINTRESOURCE(IDD_CPANEL_DEVICES);
  38. psp.pfnDlgProc = (DLGPROC)DevicesDlgProc;
  39. psp.lParam = 0;
  40. psh.phpage[psh.nPages] = CreatePropertySheetPage(&psp);
  41. if(psh.phpage[psh.nPages])
  42. psh.nPages++;
  43. PropertySheet(&psh); // BUGBUG <- What do we do if this fails ??
  44. ReleaseMutex(hMutex);
  45. CloseHandle(hMutex);
  46. }