示例#1
0
void
THelpFileManager::SetHelpCursor()
{
  if(!HelpCursor){
    TApplication* app = TYPESAFE_DOWNCAST(this, TApplication);
    if(app)
      HelpCursor = new TCursor(*app, TResId(IDC_HELPCURSOR));
  }
  ::SetCursor(*HelpCursor);
}
示例#2
0
//
/// Loads a "hand" cursor from the winhlp32.exe module.
//
/// \note It appeared in Paul DiLascia's Jan 1998 MSJ articles.
void
TUrlLink::SetupCursor()
{
  SetCursor(GetModule(), IDC_HANDCURSOR);
  if(HCursor == 0){
    // if was problem try load cursor from winhlp32.exe
    // Get the windows directory
    TAPointer<tchar> Buffer(new tchar[MAX_PATH]);
    ::GetWindowsDirectory(Buffer, MAX_PATH);
     _tcscat(Buffer,_T("\\winhlp32.exe"));
    // This retrieves cursor #106 from winhlp32.exe, which is a hand pointer
    HMODULE hModule = ::LoadLibrary(Buffer);
    if (hModule) {
      HCURSOR hHandCursor = ::LoadCursor(hModule, TResId(106));
      if (hHandCursor)
        HCursor = CopyCursor(hHandCursor); // it is a macro in Win32

      ::FreeLibrary(hModule);
    }
  }
}