home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
Property.c
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
3KB
|
100 lines
/* Property - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This function opens and displays the Control Panel applet's property
** sheet window. This dialog forms the only user interface to this
** CPL module.
**
** Called: w = window handle to the parent.
**
** Returns: TRUE upon success, or FALSE if an error exists.
*/
#include "AppPaths.h"
static int dialog (HWND w);
extern BOOL Property (HWND w)
{
return (dialog (w));
}
static int dialog (HWND w)
{
auto PROPSHEETHEADER hdr = { NIL };
auto PROPSHEETPAGE page[5] = { NIL };
auto DWORD htype = PSH_PROPSHEETPAGE | PSH_NOAPPLYNOW
| PSH_USEHICON | PSH_HASHELP;
auto DWORD stype = PSP_USETITLE | PSP_HASHELP;
// Property Sheet Header ===================================================
hdr.dwSize = sizeof (PROPSHEETHEADER);
hdr.dwFlags = htype;
hdr.hwndParent = w;
hdr.hInstance = applet;
hdr.hIcon = LoadIcon (applet,(LPCTSTR) APPLICATION_ICON);
hdr.pszCaption = "MS Windows Application Paths";
hdr.nPages = 5;
hdr.nStartPage = NIL;
hdr.ppsp = page;
// Application Property Sheet ==============================================
page[TAB_1].dwSize = sizeof (PROPSHEETPAGE);
page[TAB_1].dwFlags = stype;
page[TAB_1].hInstance = applet;
page[TAB_1].pszTemplate = (LPCSTR) PATH_TAB;
page[TAB_1].pfnDlgProc = (DLGPROC) PathTab;
page[TAB_1].pszTitle = "Applications";
page[TAB_1].lParam = NIL;
// Run Property Sheet ======================================================
page[TAB_2].dwSize = sizeof (PROPSHEETPAGE);
page[TAB_2].dwFlags = stype;
page[TAB_2].hInstance = applet;
page[TAB_2].pszTemplate = (LPCSTR) RUN_TAB;
page[TAB_2].pfnDlgProc = (DLGPROC) RunTab;
page[TAB_2].pszTitle = "Startup";
page[TAB_2].lParam = NIL;
// Service Property Sheet ======================================================
page[TAB_3].dwSize = sizeof (PROPSHEETPAGE);
page[TAB_3].dwFlags = stype;
page[TAB_3].hInstance = applet;
page[TAB_3].pszTemplate = (LPCSTR) SRV_TAB;
page[TAB_3].pfnDlgProc = (DLGPROC) ServiceTab;
page[TAB_3].pszTitle = "Services";
page[TAB_3].lParam = NIL;
// Help Files Property Sheet ===============================================
page[TAB_4].dwSize = sizeof (PROPSHEETPAGE);
page[TAB_4].dwFlags = stype;
page[TAB_4].hInstance = applet;
page[TAB_4].pszTemplate = (LPCSTR) HELP_TAB;
page[TAB_4].pfnDlgProc = (DLGPROC) HelpTab;
page[TAB_4].pszTitle = "Help Files";
page[TAB_4].lParam = NIL;
// About AppPaths Property Sheet ===========================================
page[TAB_5].dwSize = sizeof (PROPSHEETPAGE);
page[TAB_5].dwFlags = stype;
page[TAB_5].hInstance = applet;
page[TAB_5].pszTemplate = (LPCSTR) ABOUT_TAB;
page[TAB_5].pfnDlgProc = (DLGPROC) AboutTab;
page[TAB_5].pszTitle = "About AppPaths";
page[TAB_5].lParam = NIL;
return (PropertySheet (&hdr));
}
/* end of Property.c - written by Gregory Braun */