home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 February
/
Chip_2002-02_cd1.bin
/
sharewar
/
apaths
/
APSOURCE.ZIP
/
AppPaths.h
< prev
next >
Wrap
C/C++ Source or Header
|
2001-03-26
|
19KB
|
451 lines
/* AppPaths.h - March 26th, 2001
**
** Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
**
** This header defines the various data structure definitions,
** manifest constants and function prototypes used throughout
** the AppPaths Control Panel Applet project.
**
** Include this header file in all project source code modules
** that reference AppPaths symbols.
**
** This header is designed to be used as a precompiled header
** in an MS Visual C/C++ project. All MS Windows 95/98/NT/2000
** Win32 API headers required to build the project are included
** prior to AppPaths definitions.
**
** Print this header file in the Landscape mode to display the
** full width of definitions.
**
*/
#ifndef APPPATHS_H // include this header only once!
#define APPPATHS_H APPPATHS_H
#define STRICT // strong lint checks
#define _WIN32_IE 0x0300 // The application will be compatible with Comctl32.dll and
// shell32.dll version 4.70 and later.
// To prevent MS Windows NT v6.x headers from generating errors at Warning Level #4
#pragma warning (disable:4115) // named type definition in parentheses
#pragma warning (disable:4201) // nonstandard extension used : nameless struct/union
#pragma warning (disable:4214) // nonstandard extension used : bit field types other than int
#pragma warning (disable:4514) // unreferenced inline function has been removed
#ifndef _INC_WINDOWS
#include <Windows.h> // Win32 API definitions.
#endif
#ifndef _INC_WINDOWSX
#include <WindowsX.h> // Win32 API macros.
#endif
#ifndef _INC_COMMDLG
#include <CommDlg.h> // Common dialog definitions.
#endif
#pragma warning (disable:4115) // named type definition in parentheses
#pragma warning (disable:4201) // nonstandard extension used : nameless struct/union
#pragma warning (disable:4214) // nonstandard extension used : bit field types other than int
#pragma warning (disable:4514) // unreferenced inline function has been removed
#ifndef _INC_COMMCTRL
#include <CommCtrl.h> // Common control definitions.
#endif
#ifndef _INC_SHELLAPI
#include <ShellAPI.h> // Win32 Shell API definitions.
#endif
#ifndef _SHLOBJ_H_
#include <ShlObj.h> // Win32 Shell Object API definitions.
#endif
#ifndef _INC_REGSTR
#include <RegStr.h> // Win32 Registry API definitions.
#endif
#ifndef _INC_CPL
#include <cpl.h> // MS Windows Control Panel definitions.
#endif
#ifdef __cplusplus // Don't mangle AppPaths symbols
extern "C" {
#endif
// --------------------------------------------------------------------------------------------------------------
#define APP_CAPTION "Application Paths\0"
#define REGSTR_PATH_HELP "Software\\Microsoft\\Windows\\Help\0"
#define VARFILEINFO_STR "\\VarFileInfo\\Translation\0"
#define WIN_RES_FMT "\\StringFileInfo\\%04X04E4\\%s\0"
#define UNI_RES_FMT "\\StringFileInfo\\%04X04B0\\%s\0"
#define LNG_RES_FMT "\\StringFileInfo\\%08lX\\%s\0"
// --------------------------------------------------------------------------------------------------------------
#define IDC_STATIC (-1) // Static dialog resource ID
#define UNUSED_ARG(x) ((x) = (x)) // for unused formal agruements
#define NIL (0) // Zero... none
#define PSTRING (0x0100) // Some safe string sizes!
#define KSTRING (0x0400)
#define MSTRING (0x0800)
#define EOS ('\0') // C Language End-Of-String
#define BLANK_STR ("\0") // Empty string
#define EXT_CHR ('.')
#define HLP_EXT (".HLP")
#define WIZARD_PICT 1000 // AboutBox graphics (154 x 256 bitmap)
#define APPLICATION_ICON 1000 // Control Panel Applet icon ID
#define HELPFILE_ICON 2000 // "HelpFile.ico"
#define WINDOWS_ICON 3000 // "Windows.ico"
#define COLUMN_1 0
#define COLUMN_2 1
#define COLUMN_3 2
#define PATH_COLS_MAX 3
#define RUN_COLS_MAX 2
#define SRV_COLS_MAX 2
#define HELP_COLS_MAX 2
#define TAB_1 0
#define TAB_2 1
#define TAB_3 2
#define TAB_4 3
#define TAB_5 4
#define RUN_MAX 64
#define SRV_MAX 64
// PATH data structure definition - used with the PathTab ListView control.
// --------------------------------------------------------------------------------------------------------------
typedef struct tagPATH {
char name[PSTRING];
char application[PSTRING];
char path[KSTRING];
int index;
} PATH;
typedef PATH far * LPPATH;
// RUN data structure definition - used with the RunTab ListView control.
// --------------------------------------------------------------------------------------------------------------
typedef struct tagRUN {
char name[PSTRING];
char path[PSTRING];
int index;
} RUN;
typedef RUN far * LPRUN;
// SRV data structure definition - used with the RunTab ListView control.
// --------------------------------------------------------------------------------------------------------------
typedef struct tagSRV {
char name[PSTRING];
char path[PSTRING];
int index;
} SRV;
typedef SRV far * LPSRV;
// HELP data structure definition - used with the HelpTab ListView control.
// --------------------------------------------------------------------------------------------------------------
typedef struct tagHELP {
char name[PSTRING];
char path[PSTRING];
int index;
} HELP;
typedef HELP far * LPHELP;
// VERSION data structure definition - used with the AboutTab .
// --------------------------------------------------------------------------------------------------------------
#define VERSION_ITEM_MAX 7
typedef struct tagVERSION_ITEM {
char label[36];
char value[PSTRING];
int id;
char sub[PSTRING];
} VERSION_ITEM;
typedef struct tagVERSION {
VERSION_ITEM item[VERSION_ITEM_MAX];
} VERSION;
// The following dialog box resources and control IDs are ordinal
// to facilitate easier Help project definitions.
// AppPaths string resource ID numbers.
// --------------------------------------------------------------------------------------------------------------
#define CPANEL_NAME 100
#define CPANEL_DESC 101
#define APP_NAME 102
#define APP_COPYRIGHT 103
#define APP_DESCRIPTION 104
#define APP_VERSION 105
#define APP_RELEASE 106
#define APP_COMMENTS 107
#define APP_WEBSITE 108
// PathTab - AppPaths property sheet control IDs
// --------------------------------------------------------------------------------------------------------------
#define PATH_TAB 1000
#define PATH_MEMBER_LST 101
#define PATH_CREATE_BTN 102
#define PATH_MODIFY_BTN 103
#define PATH_REMOVE_BTN 104
// Path Editor Dialog Box resource IDs
// --------------------------------------------------------------------------------------------------------------
#define PATH_DLG 2000
#define PATH_ICON_PIC 201
#define PATH_NAME_TXT 202
#define PATH_APPLICATION_TXT 203
#define PATH_PATH_TXT 204
#define PATH_APPLICATION_BTN 205
#define PATH_PATH_BTN 206
#define PATH_HELP_BTN 207
// RunTab - Run property sheet control IDs
// --------------------------------------------------------------------------------------------------------------
#define RUN_TAB 3000
#define RUN_MEMBER_LST 301
#define RUN_MACHINE_BOX 302
#define RUN_USER_BOX 303
#define RUN_CREATE_BTN 304
#define RUN_MODIFY_BTN 305
#define RUN_REMOVE_BTN 306
// Run Editor Dialog Box resource IDs
// --------------------------------------------------------------------------------------------------------------
#define RUN_DLG 4000
#define RUN_ICON_PIC 401
#define RUN_NAME_TXT 402
#define RUN_PATH_TXT 403
#define RUN_PATH_BTN 404
#define RUN_HELP_BTN 405
// ServicesTab - Services property sheet control IDs
// --------------------------------------------------------------------------------------------------------------
#define SRV_TAB 5000
#define SRV_MEMBER_LST 501
#define SRV_CREATE_BTN 502
#define SRV_MODIFY_BTN 503
#define SRV_REMOVE_BTN 504
// Service Editor Dialog Box resource IDs
// --------------------------------------------------------------------------------------------------------------
#define SRV_DLG 6000
#define SRV_ICON_PIC 601
#define SRV_NAME_TXT 602
#define SRV_PATH_TXT 603
#define SRV_PATH_BTN 604
#define SRV_HELP_BTN 605
// HelpTab - HelpFiles property sheet control IDs
// --------------------------------------------------------------------------------------------------------------
#define HELP_TAB 7000
#define HELP_MEMBER_LST 701
#define HELP_CREATE_BTN 702
#define HELP_MODIFY_BTN 703
#define HELP_REMOVE_BTN 704
// Help Editor Dialog Box resource IDs
// --------------------------------------------------------------------------------------------------------------
#define HELP_DLG 8000
#define HELP_NAME_TXT 801
#define HELP_PATH_TXT 802
#define HELP_PATH_BTN 803
#define HELP_HELP_BTN 804
// AboutTab - About box property sheet control IDs
// --------------------------------------------------------------------------------------------------------------
#define ABOUT_TAB 9000
#define ABOUT_WIZARD_PIC 900
#define ABOUT_ICON_PIC 901
#define ABOUT_NAME_TXT 902
#define ABOUT_COPYRIGHT_TXT 903
#define ABOUT_DESCRIPTION_TXT 904
#define ABOUT_VERSION_TXT 905
#define ABOUT_RELEASE_TXT 906
#define ABOUT_COMMENTS_TXT 907
#define ABOUT_WEBSITE_BTN 908
// Global AppPaths variables ===================================================================================
extern HINSTANCE far applet; // Control Panel applet instance handle.
extern char far program[PSTRING]; // Module name
extern char far helpfile[PSTRING]; // Module help filespec.
// External (global) AppPaths function prototypes ==============================================================
// The following functions and procedures are found in files having the
// same name as the routine itself.
BOOL WINAPI DllMain (HINSTANCE instance,ULONG type,LPVOID reserved);
LONG CALLBACK CPlApplet (HWND w,UINT msg,LONG wp,LONG lp);
extern BOOL Property (HWND w);
extern UINT CALLBACK PathTab (HWND w,UINT msg,WPARAM wp,LPARAM lp);
extern UINT CALLBACK RunTab (HWND w,UINT msg,WPARAM wp,LPARAM lp);
extern UINT CALLBACK ServiceTab (HWND w,UINT msg,WPARAM wp,LPARAM lp);
extern UINT CALLBACK HelpTab (HWND w,UINT msg,WPARAM wp,LPARAM lp);
extern UINT CALLBACK AboutTab (HWND w,UINT msg,WPARAM wp,LPARAM lp);
extern BOOL far GetPKeys (HWND list);
extern BOOL far GetPString (LPCSTR section,LPCSTR label,LPCSTR def,LPSTR value,DWORD size);
extern BOOL far KillPKey (LPPATH path);
extern BOOL far MakePKey (LPPATH path);
extern BOOL far GetRKeys (HWND list,BOOL user);
extern BOOL far KillRKey (LPRUN run,BOOL user);
extern BOOL far MakeRKey (LPRUN run,BOOL user);
extern BOOL far GetHKeys (HWND list);
extern BOOL far KillHKey (LPHELP help);
extern BOOL far MakeHKey (LPHELP help);
extern BOOL far GetSKeys (HWND list);
extern BOOL far KillSKey (LPSRV srv);
extern BOOL far MakeSKey (LPSRV srv);
extern BOOL far EditPath (HWND w,LPPATH path);
extern BOOL far EditRun (HWND w,LPRUN run);
extern BOOL far EditService (HWND w,LPSRV srv);
extern BOOL far EditHelp (HWND w,LPHELP help);
extern BOOL far PickApp (HWND w,LPSTR filespec);
extern BOOL far PickPath (HWND w,LPCSTR msg,LPSTR path);
extern LPSTR far SysError (DWORD err,LPSTR string);
extern BOOL far WebSite (HWND w,LPCSTR website);
extern BOOL far HelpTopic (HWND w,DWORD id);
extern BOOL far HelpTip (HWND w,int id);
extern LPSTR far lstrrchr (LPSTR string,int c);
// LV_Help.c ---------------------------------------------------------------------------------------------------
extern int far LV_RowHit (HWND list);
extern int far LV_GetCurSel (HWND list);
extern int far LV_SetCurSel (HWND list,int index);
// PL_Help.c ---------------------------------------------------------------------------------------------------
extern BOOL far PL_GetItem (HWND list,int index,LPPATH path);
extern BOOL far PL_PutItem (HWND list,int index,LPPATH path);
extern BOOL far PL_AddItem (HWND list,LPPATH path);
// RL_Help.c ---------------------------------------------------------------------------------------------------
extern BOOL far RL_GetItem (HWND list,int index,LPRUN run);
extern BOOL far RL_PutItem (HWND list,int index,LPRUN run);
extern BOOL far RL_AddItem (HWND list,LPRUN run);
// SL_Help.c ---------------------------------------------------------------------------------------------------
extern BOOL far SL_GetItem (HWND list,int index,LPSRV srv);
extern BOOL far SL_PutItem (HWND list,int index,LPSRV srv);
extern BOOL far SL_AddItem (HWND list,LPSRV srv);
// HL_Help.c ---------------------------------------------------------------------------------------------------
extern BOOL far HL_GetItem (HWND list,int index,LPHELP help);
extern BOOL far HL_PutItem (HWND list,int index,LPHELP help);
extern BOOL far HL_AddItem (HWND list,LPHELP help);
// DlgHelp.c ---------------------------------------------------------------------------------------------------
extern BOOL far SetDlgIcon (HWND dlg,int id);
extern BOOL far SetDFocus (HWND dlg,int item);
extern BOOL far SetDlgItemSize (HWND dlg,int item,DWORD size);
// Messages.c --------------------------------------------------------------------------------------------------
extern BOOL far Message (HWND w,LPCSTR caption,LPCSTR message);
extern BOOL far Error (HWND w,LPCSTR caption,LPCSTR message);
extern BOOL far Query (HWND w,LPCSTR caption,LPCSTR message);
extern BOOL far Beeper (void);
#ifdef __cplusplus
}
#endif
#endif
/* end of AppPaths.h - written by Gregory Braun */