home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 February / Chip_2002-02_cd1.bin / sharewar / apaths / APSOURCE.ZIP / WebSite.c < prev   
C/C++ Source or Header  |  2001-03-26  |  1KB  |  44 lines

  1. /* WebSite - March 26th, 2001
  2. **
  3. **      Copyright (c) 1997-2001 by Gregory Braun. All rights reserved.
  4. **
  5. **      This functions launches the user's Web Browser and goes
  6. **      directly to the Software Design Web Site on the Internet.
  7. **
  8. **      Called:     w       = window handle to the parent.
  9. **                  website = the URL to be used.
  10. **
  11. **      Returns:    TRUE upon success, or FALSE if an error exists.
  12. **
  13. **      Notes:      This function works with the Microsoft Windows
  14. **                  Internet Explorer only!
  15. */
  16.  
  17. #include "AppPaths.h"
  18.  
  19. #define NAVIGATOR       "Netscape.exe"
  20.  
  21. #define WEBSITE_ERR     "URL: %s\r\r" \
  22.                         "Cannot launch the Microsoft Internet Explorer or\r" \
  23.                         "Netscape Navigator web browser applications.\r\r" \
  24.                         "Error Code: %u"
  25.  
  26.  
  27. extern BOOL far WebSite (HWND w,LPCSTR website)
  28. {
  29.     auto HANDLE     h;
  30.     auto char       message[MSTRING];
  31.  
  32.     if ((h = ShellExecute (w,NULL,website,NULL,NULL,SW_SHOW)) > (HANDLE) 32)
  33.         return (TRUE);
  34.  
  35.     if ((h = ShellExecute (w,NULL,NAVIGATOR,website,NULL,SW_SHOW)) > (HANDLE) 32)
  36.         return (TRUE);
  37.  
  38.     wsprintf (message,WEBSITE_ERR,website,(UINT) h);
  39.  
  40.     return (Message (w,NULL,message));
  41. }
  42.  
  43. /* end of WebSite.c - written by Gregory Braun */
  44.