--- mstools/samples/deb/debmain.h 2018/08/09 18:21:31 1.1.1.2 +++ mstools/samples/deb/debmain.h 2018/08/09 18:23:33 1.1.1.3 @@ -1,22 +1,14 @@ -// ************************************************************************ -// -// Microsoft Developer Support -// Copyright (c) 1992 Microsoft Corporation -// -// ************************************************************************ -// HEADER : DEBMain.H -// PURPOSE : A Win32 Application demonstrating the Debug APIs -// FUNCTIONS : -// WinMain() - application entry point -// MainWndProc() - processes messages -// ProcessCommandsWndProc() - processes WM_COMMAND messages -// PreferencesDlgProc() - processes messages for "Preferences" dialog box -// AttachDlgProc() - processes messages for "Attach" dialog box -// AboutDlgProc() - processes messages for "About" dialog box -// NewListBoxWndProc() - subclass procedure to prevent listbox moving -// COMMENTS : -// -// ************************************************************************ + +/******************************************************************************\ +* This is a part of the Microsoft Source Code Samples. +* Copyright (C) 1993 Microsoft Corporation. +* All rights reserved. +* This source code is only intended as a supplement to +* Microsoft Development Tools and/or WinHelp documentation. +* See these sources for detailed information regarding the +* Microsoft samples programs. +\******************************************************************************/ + #ifndef DEBMAIN_H #define DEBMAIN_H @@ -25,38 +17,60 @@ #include "DEB.H" // resource and message ids #endif + // ******** + // typedefs + // ******** + typedef struct PROFILE_STRUCT { + INT xPos; // application window's horizontal position + INT yPos; // application window's vertical position + INT nWidth; // application window's width + INT nHeight; // application window's height + BOOL fMaximized; // flag: maximized state? + BOOL fMinimized; // flag: minimized state? + BOOL fToolBar; // flag: display the ToolBar? + BOOL fSavedDirectory; // flag: use saved directory for opening files? + TCHAR szInitialDir[MAX_PATH]; // initial directory for debuggees + LOGFONT LogFont; // current logical font + COLORREF rgbForeColor; // current listbox text foreground color + COLORREF rgbBackColor; // current listbox text foreground color + BOOL fClearOnNew; // flag: clears the event listbox on a new debuggee + BOOL fVerbose; // flag: verbose event listings + BOOL fShowSymbols; // flag: show symbols (limited) + LONG DebugMode; // debug mode flag CreateProcess + LONG DebuggeePriority; // debuggee priority CreateProcess + DWORD DebugErrorLevel; // debugger error level + BOOL fSavePreferences; // flag: save the preferences settings + BOOL fSaveOnExit; // flag: save settings upon exit? + } PROFILE, *PPROFILE; + + typedef struct GLOBAL_STRUCT { + HINSTANCE hInstance; // current instance + HWND hWndMain; // Main window handle + HWND hWndListBox; // debug event listbox handle + HWND hWndToolBar; // windows handle to the text toolbar + WNDPROC OldListBoxWndProc; // original listbox procedure + TCHAR szAppName[64]; // name of the application + TCHAR szShortAppName[32]; // short name of the application + TCHAR szApiFailedMsg[64]; // "A Windows API Failed" message + LONG MaxStrLen; // maximum string length in Debug Event listbox + DWORD dwActiveDebuggees; // count of active debuggee processes + SIZE ClientSize; // client windows size + SIZE ListBoxSize; // debug event listbox size + INT ToolBarHeight; // text button bar height + INT xPosOld; // application window's old horizontal pos + INT yPosOld; // application window's old vertical pos + HICON hIconCurrent; // handle to the current animated icon + UINT idIconTimer; // timer id for animated icons + HWND hDlgAbout; // handle to the About dialog box + BOOL fAboutBox; // boolean indicating if the About box is + // active + BOOL fHelpUsed; // boolean denoting online help invoked + } GLOBAL, *PGLOBAL; + // *********** // global data // *********** - extern HWND hWndMain; // main window handle - extern HWND hWndDebugList; // debug event listbox handle - extern HWND hWndTextButtonBar; // windows handle to the text toolbar - extern HINSTANCE hInstance; // instance handle of this EXE - extern TCHAR szAppTitle[32]; // name of the application - extern LONG MaxStrLen; // maximum string length in Debug Event listbox - extern DWORD dwActiveDebugees; // number of active debugees - extern LIST ProcessList; // linked list of debugee process information - extern INT ActiveProcesses; // count of active debugee processes - extern HANDLE hProcess; // handle to current running debugee process - - //-- private profile settings - extern int xPos; // application window's horizontal position - extern int yPos; // application window's vertical position - extern int nWidth; // application window's width - extern int nHeight; // application window's height - extern BOOL fMaximized; // flag: maximized state? - extern BOOL fToolBar; // flag: display the ToolBar? - extern BOOL fSaveOnExit; // flag: save settings upon exit? - extern BOOL fSavedDirectory; // flag: use saved directory for opening files? - extern BOOL fClearOnNew; // flag: clears the event listbox on a new debugee - extern BOOL fVerbose; // flag: verbose event listings - extern BOOL fShowSymbols; // flag: show symbols (limited) - extern BOOL fSavePreferences; // flag: save the preferences settings - extern HFONT hFont; // current handle to the Debug Event listbox font - extern LOGFONT LogFont; // current logical font - extern COLORREF rgbColor; // current listbox text foreground color - extern COLORREF rgbBkColor; // current listbox text foreground color - extern LONG DebugMode; // debug mode flag CreateProcess - extern LONG DebugeePriority; // debugee priority CreateProcess + extern GLOBAL Global; // various global data + extern PROFILE Profile; // various profile data #endif // DEBMAIN_H