www.pudn.com > Process_Mo18292312142004.rar > Window.h


 
/******************************************************* 
 
   This file is part of Process Monitor. 
	 
   Copyright (c) 2004 by Michel van Kerkhof, ( michel000@planet.nl  http://home.wxs.nl/~wijk0550/ )            
   For more information consult the Readme file.        
                                                                                                                                                                    
   This program is free software; you can redistribute it      
   and/or modify it under the terms of the GNU          
   General Public License as published by the Free      
   Software Foundation; either version 2 of the         
   License, or (at your option) any later version.      
                                                        
   This program is distributed in the hope that it will        
   be useful, but WITHOUT ANY WARRANTY; without         
   even the implied warranty of  MERCHANTABILITY        
   or FITNESS FOR A PARTICULAR PURPOSE.  See the        
   GNU General Public License for more details.         
                                                        
   You should have received a copy of the GNU           
   General Public License along with this program;  
   if not, write to: 
   the Free Software Foundation, Inc.,         
   59 Temple Place,                                     
   Suite 330, Boston,                                   
   MA  02111-1307  USA                                  
                                                        
******************************************************* 
 
   If you like my work and you have a job for me please contact me at: michel000@planet.nl 
   
*******************************************************/ 
 
 
 
#ifndef WINDOW_H 
#define WINDOW_H 
 
#define XNM_CLICK WM_USER + 1000 
 
typedef struct { 
	RECT WinRect; 
	int SubListViewOption; 
	double dSplitter; 
	int UpdateSpeedOption; 
	bool bHideWhenMinimized; 
} SETTINGS; 
 
 
class CProcList; 
class CProcInfo; 
class CModuleInfo; 
class CHandleInfo; 
 
class CWindow { 
private: 
	SETTINGS Settings; 
	HINSTANCE hInst; 
	bool bSplitter; 
	char szTitleBar[128]; 
	char *pTitleBar; 
#ifdef CHECK_LAG 
	int m_dwOldTickCount; 
#endif 
	bool m_bLagging; 
	int SaveSubListViewOption; 
	HMENU	hTrayPopup; 
	int iUpdateSpeed; 
	HWND hExtra; 
	void LogItem(int iItem); 
	void ChangeSubWindow(DWORD dwSubWindow); 
	bool LoadSettings(); 
	void SetSpeed(int iItem); 
	void SetTaskMgr(bool bSet); 
	void HideWhenMinimized(bool bSet); 
	void TerminateProc(HWND hWnd,PROCESSLIST *ProcList,bool bDelete); 
	void SetPriority(HWND hWnd,PROCESSLIST *ProcList,DWORD dwPri); 
	void SetClipBoardText(char *szText); 
	void GetProperties(HWND hWnd,PROCESSLIST *ProcList); 
	void DebugProc(HWND hWnd,PROCESSLIST *ProcList); 
	void RunDlg(HWND hWnd); 
	void *pClipBoard; 
	CProcInfo	*CExtra; 
	CModuleInfo	*CModule; 
	CHandleInfo  *CHandle; 
protected: 
	char szSearchString[MAX_PATH]; 
	int  iSearchOption; 
	int  m_iDataOption; 
	HANDLE hLogFile; 
	CProcList *CProc; 
	HWND hProcList,hMain,hStatus; 
	LRESULT mySendMessage(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM lParam); 
	void StartLog(int iItem); 
	HMENU	m_hListViewPopup, 
			hProcPopup; 
 
public: 
	bool bUpdate; 
 
	CWindow(); 
	~CWindow(){ 
	}; 
 
	bool GetHideWhenMinimizedState() { 
		return Settings.bHideWhenMinimized; 
	} 
 
	void SetSize(); 
	void TrayIcon(HWND hWnd,LPARAM lParam,WPARAM wParam); 
	 
	//Create windows 
	HWND CreateMainWindow(HINSTANCE hInstance); 
	HWND ProcessListView(HWND hWnd); 
	 
	//splitter 
	void SplitterSetSize(); 
	void SplitterStart(bool bStart); 
 
	//commands 
	void Notify(HWND hWnd,WPARAM wParam,LPARAM lParam); 
	void Commands(HWND hWnd,WPARAM wParam,LPARAM lParam); 
	void Timers(HWND hWnd,WPARAM wParam,LPARAM lParam); 
 
	int SaveSettings(); 
 
	friend class CProcInfo; 
	friend class CProcList; 
	friend class CModuleInfo; 
	friend class CHandleInfo; 
}; 
 
LRESULT CALLBACK mainWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); 
 
 
#endif