home *** CD-ROM | disk | FTP | other *** search
/ PC Administrator / spravce.iso / RunModule / src / RunModule1.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-06-18  |  3.9 KB  |  100 lines

  1. // RunModule1.h: interface for the CRunModule class.
  2. //
  3. /*
  4. Copyright 2001 Anish Mistry. All rights reserved.
  5.  
  6. Redistribution and use in source and binary forms, with or without modification,
  7. are permitted provided that the following conditions are met:
  8.  
  9.    1. Redistributions of source code must retain the above copyright notice, 
  10.    this list of conditions and the following disclaimer.
  11.    2. Redistributions in binary form must reproduce the above copyright notice,
  12.    this list of conditions and the following disclaimer in the documentation 
  13.    and/or other materials provided with the distribution.
  14.  
  15. THIS SOFTWARE IS PROVIDED BY ANISH MISTRY ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  16. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
  17. AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 
  18. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  19. OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  20. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  21. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  22. TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24.  
  25. The views and conclusions contained in the software and documentation are those
  26. of the authors and should not be interpreted as representing official policies,
  27. either expressed or implied, of Anish Mistry or AM Productions.
  28.  
  29. * Variation of the FreeBSD License. http://www.freebsd.org/copyright/freebsd-license.html
  30. */
  31. //////////////////////////////////////////////////////////////////////
  32.  
  33. #if !defined(AFX_RUNMODULE1_H__68BD483C_25CE_4E0F_8C7C_743F3DA794D2__INCLUDED_)
  34. #define AFX_RUNMODULE1_H__68BD483C_25CE_4E0F_8C7C_743F3DA794D2__INCLUDED_
  35.  
  36. #if _MSC_VER > 1000
  37. #pragma once
  38. #endif // _MSC_VER > 1000
  39.  
  40. #include "ButtonImage.h"
  41. #include "CheckBoxImage.h"
  42. #include "RadioButtonImage.h"
  43. #include "GroupBoxImage.h"
  44. #include "CommandLine.h"
  45. #include "MyDialog.h"
  46. #include "StdFile.h"
  47. #include "RunModuleListFile.h"
  48. #include "About.h"
  49. #include "ExecuteProcess.h"
  50. #include "RunModuleData.h"
  51. #include "ComboCommand.h"
  52. #include "SnapDlg.h"
  53.  
  54. class CRunModule : public CSnapDlg
  55. {
  56. public:
  57.     bool Init(HINSTANCE hInstance,HWND hParent,unsigned long nTemplateID,bool bDoModal = true);
  58.     int GetErrorCode(){return m_nErrorCode;}
  59.     void OnButtonOk();    // needs to be public for threading
  60.     static int RunProgram(char *pObject,char *pCommand);
  61.     CRunModule();
  62.     CRunModule(const char *pCommandLine);
  63.     virtual ~CRunModule();
  64. protected:
  65.     void LoadWindowPlacement(HWND hWnd,const char *pName);
  66.     void OnAbout();
  67.     virtual bool OnSysCommand(WPARAM wParam,LPARAM lParam);
  68.     const char *GetErrorMessage(char *pBuffer);
  69.     int BatchRun(int nDelayExec, bool bIgnoreErr);
  70.     bool OnCommand(WPARAM wParam, LPARAM lParam);
  71.     LRESULT DlgProc(HWND hDlg,UINT nMessage,WPARAM wParam,LPARAM lParam);
  72.     bool LoadRunComboBox();
  73.     bool HasChar(char *pString,char cChar);
  74.     void DisplayMessage(const char *pMessage);
  75.     bool LoadItemCommand();
  76.     void OnButtonBrowse();
  77.     unsigned long int GetNextThreadID();
  78.     virtual bool OnDestroy();
  79.     bool OnInitDialog(HWND hDlg);
  80.     LRESULT OnLButtonDown(WPARAM wParam,LPARAM lParam);
  81.     LRESULT OnContextMenu(WPARAM wParam,LPARAM lParam);
  82.     void OnHotKey(WPARAM wParam,LPARAM lParam);
  83.  
  84.     CButtonImage m_biOkButton;
  85.     CButtonImage m_biCancelButton;
  86.     CButtonImage m_biBrowseButton;
  87.     CButtonImage m_biAboutButton;
  88.     CCheckBoxImage m_cbiCloseCheck;
  89.     unsigned long int m_nThreadID;
  90.     int m_nErrorCode;
  91.     char m_pListFile[MAX_PATH];
  92.     bool m_bNoCaption;
  93.     bool m_bHideDescriptions;
  94.     bool m_bShellSafe;
  95.     CComboCommand m_ccObject;
  96.     CComboAutoComplete m_cacCommand;
  97. };
  98.  
  99. #endif // !defined(AFX_RUNMODULE1_H__68BD483C_25CE_4E0F_8C7C_743F3DA794D2__INCLUDED_)
  100.