HyprLink.h 783 B

12345678910111213141516171819202122232425262728293031
  1. ////////////////////////////////////////////////////////////////
  2. // PixieLib(TM) Copyright 1997-2000 Paul DiLascia
  3. // If this code works, it was written by Paul DiLascia.
  4. // If not, I don't know who wrote it.
  5. //
  6. // CHyperlink implements a simple text hyperlink
  7. //
  8. #ifndef _HYPRILNK_H
  9. #define _HYPRILNK_H
  10. //////////////////
  11. // Simple text hyperlink derived from CString
  12. //
  13. class CHyperlink : public CString {
  14. public:
  15. CHyperlink(LPCTSTR lpLink = NULL) : CString(lpLink) { }
  16. ~CHyperlink() { }
  17. const CHyperlink& operator=(LPCTSTR lpsz) {
  18. CString::operator=(lpsz);
  19. return *this;
  20. }
  21. operator LPCTSTR() {
  22. return CString::operator LPCTSTR();
  23. }
  24. virtual HINSTANCE Navigate() {
  25. return IsEmpty() ? NULL :
  26. ShellExecute(0, _T("open"), *this, 0, 0, SW_SHOWNORMAL);
  27. }
  28. };
  29. #endif