home *** CD-ROM | disk | FTP | other *** search
/ PC Administrator / spravce.iso / TaskModule / src / About.cpp next >
Encoding:
C/C++ Source or Header  |  2001-09-10  |  3.0 KB  |  83 lines

  1. // About.cpp: implementation of the CAbout 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. #include "stdafx.h"
  34. #include "About.h"
  35. #include <shellapi.h>
  36.  
  37. void SetAppDirectoryAsCurrent(void);
  38.  
  39. //////////////////////////////////////////////////////////////////////
  40. // Construction/Destruction
  41. //////////////////////////////////////////////////////////////////////
  42.  
  43. CAbout::CAbout()
  44. {
  45.  
  46. }
  47.  
  48. CAbout::~CAbout()
  49. {
  50.  
  51. }
  52.  
  53. bool CAbout::OnCommand(WPARAM wParam, LPARAM lParam)
  54. {// begin OnCommand
  55.     int nID = LOWORD(wParam); 
  56. //    int nEvent = HIWORD(wParam); 
  57.  
  58.     switch (nID)
  59.     {// begin parse controls
  60.         case IDC_BUTTON_WEBSITE:
  61.             ShellExecute(NULL,"open","http://am-productions.yi.org/",NULL,NULL,SW_SHOW);
  62.             break;
  63.         case IDC_BUTTON_EMAIL:
  64.             ShellExecute(NULL,"open","mailto:amistry@am-productions.yi.org",NULL,NULL,SW_SHOW);
  65.             break;
  66.         case IDC_BUTTON_REGISTER:
  67.             ShellExecute(NULL,"open","http://am-productions.yi.org/reg.php",NULL,NULL,SW_SHOW);
  68.             break;
  69.         case IDC_BUTTON_HELP:
  70.             OnButtonHelp();
  71.             break;
  72.     }// end parse controls
  73.     return CMyDialog::OnCommand(wParam,lParam);
  74. }// end OnCommand
  75.  
  76. void CAbout::OnButtonHelp()
  77. {// begin OnButtonHelp
  78.     char pCurrentDir[MAX_PATH] = {NULL};
  79.     GetCurrentDirectory(MAX_PATH-1,pCurrentDir);
  80.     SetAppDirectoryAsCurrent();
  81.     ShellExecute(NULL,"open","readme.txt",NULL,NULL,SW_SHOWNORMAL);
  82. }// end OnButtonHelp
  83.