home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / Chip_2002-02_cd1.bin / sharewar / apaths / APSOURCE.ZIP / Property.c < prev    next >
C/C++ Source or Header  |  2001-03-26  |  3KB  |  100 lines

  1. /* Property - March 26th, 2001
  2. **
  3. **      Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
  4. **
  5. **      This function opens and displays the Control Panel applet's property
  6. **      sheet window. This dialog forms the only user interface to this
  7. **      CPL module.
  8. **
  9. **      Called:     w = window handle to the parent.
  10. **
  11. **      Returns:    TRUE upon success, or FALSE if an error exists.
  12. */
  13.  
  14. #include "AppPaths.h"
  15.  
  16. static int      dialog  (HWND w);
  17.  
  18. extern BOOL Property (HWND w)
  19. {
  20.     return (dialog (w));
  21. }
  22.  
  23. static int dialog (HWND w)
  24. {
  25.     auto PROPSHEETHEADER    hdr     = { NIL };
  26.     auto PROPSHEETPAGE      page[5] = { NIL };
  27.  
  28.     auto DWORD              htype   = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW
  29.                                     | PSH_USEHICON | PSH_HASHELP;
  30.  
  31.     auto DWORD              stype   = PSP_USETITLE | PSP_HASHELP;
  32.  
  33.  
  34. //  Property Sheet Header ===================================================
  35.  
  36.     hdr.dwSize              = sizeof (PROPSHEETHEADER);
  37.     hdr.dwFlags             = htype;
  38.     hdr.hwndParent          = w;
  39.     hdr.hInstance           = applet;
  40.     hdr.hIcon               = LoadIcon (applet,(LPCTSTR) APPLICATION_ICON);
  41.     hdr.pszCaption          = "MS Windows Application Paths";
  42.     hdr.nPages              = 5;
  43.     hdr.nStartPage          = NIL;
  44.     hdr.ppsp                = page;
  45.  
  46. //  Application Property Sheet ==============================================
  47.  
  48.     page[TAB_1].dwSize      = sizeof (PROPSHEETPAGE);
  49.     page[TAB_1].dwFlags     = stype;
  50.     page[TAB_1].hInstance   = applet;
  51.     page[TAB_1].pszTemplate = (LPCSTR)  PATH_TAB;
  52.     page[TAB_1].pfnDlgProc  = (DLGPROC) PathTab;
  53.     page[TAB_1].pszTitle    = "Applications";
  54.     page[TAB_1].lParam      = NIL;
  55.  
  56. //  Run Property Sheet ======================================================
  57.  
  58.     page[TAB_2].dwSize      = sizeof (PROPSHEETPAGE);
  59.     page[TAB_2].dwFlags     = stype;
  60.     page[TAB_2].hInstance   = applet;
  61.     page[TAB_2].pszTemplate = (LPCSTR)  RUN_TAB;
  62.     page[TAB_2].pfnDlgProc  = (DLGPROC) RunTab;
  63.     page[TAB_2].pszTitle    = "Startup";
  64.     page[TAB_2].lParam      = NIL;
  65.  
  66. //  Service Property Sheet ======================================================
  67.  
  68.     page[TAB_3].dwSize      = sizeof (PROPSHEETPAGE);
  69.     page[TAB_3].dwFlags     = stype;
  70.     page[TAB_3].hInstance   = applet;
  71.     page[TAB_3].pszTemplate = (LPCSTR)  SRV_TAB;
  72.     page[TAB_3].pfnDlgProc  = (DLGPROC) ServiceTab;
  73.     page[TAB_3].pszTitle    = "Services";
  74.     page[TAB_3].lParam      = NIL;
  75.  
  76. //  Help Files Property Sheet ===============================================
  77.  
  78.     page[TAB_4].dwSize      = sizeof (PROPSHEETPAGE);
  79.     page[TAB_4].dwFlags     = stype;
  80.     page[TAB_4].hInstance   = applet;
  81.     page[TAB_4].pszTemplate = (LPCSTR)  HELP_TAB;
  82.     page[TAB_4].pfnDlgProc  = (DLGPROC) HelpTab;
  83.     page[TAB_4].pszTitle    = "Help Files";
  84.     page[TAB_4].lParam      = NIL;
  85.  
  86. //  About AppPaths Property Sheet ===========================================
  87.  
  88.     page[TAB_5].dwSize      = sizeof (PROPSHEETPAGE);
  89.     page[TAB_5].dwFlags     = stype;
  90.     page[TAB_5].hInstance   = applet;
  91.     page[TAB_5].pszTemplate = (LPCSTR)  ABOUT_TAB;
  92.     page[TAB_5].pfnDlgProc  = (DLGPROC) AboutTab;
  93.     page[TAB_5].pszTitle    = "About AppPaths";
  94.     page[TAB_5].lParam      = NIL;
  95.  
  96.     return (PropertySheet (&hdr));
  97. }
  98.  
  99. /* end of Property.c - written by Gregory Braun */
  100.