当前位置: 首页>>代码示例>>C++>>正文


C++ TApplication::GetMainWindow方法代码示例

本文整理汇总了C++中TApplication::GetMainWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ TApplication::GetMainWindow方法的具体用法?C++ TApplication::GetMainWindow怎么用?C++ TApplication::GetMainWindow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TApplication的用法示例。


在下文中一共展示了TApplication::GetMainWindow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ToBool

//
/// Called by EvHelp() to activate the help file with the help context ID.
//
void
THelpFileManager::ActivateHelp(TWindow* /*window*/, int helpFileContextId, uint helpCmd)
{
  if (helpCmd == HELP_INDEX || helpCmd == HELP_CONTENTS)
    helpCmd = HELP_FINDER;
  TApplication* app = TYPESAFE_DOWNCAST(this, TApplication);
#if !defined(NO_HTMLHELP)
  if(UseHTMLHelp){
    if (app)
      HelpState = ToBool(HtmlHelp(app->GetMainWindow(), GetHelpFile().c_str(),
                                  helpCmd, helpFileContextId) != 0);
    else
      HelpState = ToBool(HtmlHelp(0, GetHelpFile().c_str(),
                                  helpCmd, helpFileContextId) != 0);
  }
  else{
#endif
    if (app)
      HelpState = ToBool(app->GetMainWindow()->WinHelp(GetHelpFile().c_str(),
                         helpCmd, helpFileContextId));
    else
      HelpState = ToBool(::WinHelp(0, GetHelpFile().c_str(),
                         helpCmd, helpFileContextId));
#if !defined(NO_HTMLHELP)
  }
#endif
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:30,代码来源:hlpmanag.cpp

示例2:

//
/// Responds to a menu item selection.
//
void
TRecentFiles::CmFile(uint id)
{
  TApplication* app    = TYPESAFE_DOWNCAST(this, TApplication);
  TFrameWindow* window = app ? app->GetMainWindow() : 0;

  if (window) {
    // Foward menu selection command to specified target
    //
    window->SendMessage(MruMessage, id, 0);
  }
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:15,代码来源:rcntfile.cpp

示例3: HtmlHelp

//
/// Deactivates the help.
//
void
THelpFileManager::DeactivateHelp()
{
  TApplication* app = TYPESAFE_DOWNCAST(this, TApplication);
#if !defined(NO_HTMLHELP)
  if(UseHTMLHelp){
    if (app)
      HtmlHelp(app->GetMainWindow(), GetHelpFile().c_str(), HELP_QUIT, 0);
    else
      HtmlHelp(0, GetHelpFile().c_str(), HELP_QUIT, 0);
  }
  else{
#endif
    if (app)
      app->GetMainWindow()->WinHelp(GetHelpFile().c_str(), HELP_QUIT, 0);
    else
      ::WinHelp(0, GetHelpFile().c_str(), HELP_QUIT, 0);
#if !defined(NO_HTMLHELP)
  }
#endif
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:24,代码来源:hlpmanag.cpp

示例4: sizeof

bool
THelpFileManager::ProcessHelpMsg (MSG& msg)
{
  if (msg.message == WM_COMMAND) {
    // help command from menu or from gadget from "what this?" for gadget
    if (ContextHelp || (::GetKeyState(VK_F1) < 0)) {
      ContextHelp = false;
      HELPINFO Info;
      Info.cbSize       = sizeof(Info);
      Info.iContextType = HELPINFO_MENUITEM;
      Info.iCtrlId      = static_cast<int>(msg.wParam);
      Info.dwContextId  = 0;
      EvHelp(Info);
      return true;
    }
  }
  else{
    switch (msg.message) {
      case WM_KEYDOWN :
        if (msg.wParam == VK_F1) {
          // If the Shift/F1 then set the help cursor and turn on the modal help state.
          if (::GetKeyState(VK_SHIFT) < 0 && !ContextHelp) {
            CmContextHelp();
            return true;        // Gobble up the message.
          }
        }
        else {
          if (ContextHelp && (msg.wParam == VK_ESCAPE)) {
            ContextHelp = false;
            TApplication* app = TYPESAFE_DOWNCAST(this, TApplication);
            if (app)
              app->GetMainWindow()->SetCursor(0, IDC_ARROW); //?????????????????
            return true;    // Gobble up the message.
          }
        }
        break;

      case WM_MOUSEMOVE :
      case WM_NCMOUSEMOVE :
        if(ContextHelp){
          SetHelpCursor();
          return true;        // Gobble up the message.
        }
        break;

      case WM_INITMENU :
        if(ContextHelp) {
           SetHelpCursor();
          return true;        // Gobble up the message.
        }
        break;

      case WM_ENTERIDLE :
        if(msg.wParam == MSGF_MENU)
          if (GetKeyState(VK_F1) < 0) {
            ContextHelp = true;
            TApplication* app = TYPESAFE_DOWNCAST(this, TApplication);
            if (app)
              app->GetMainWindow()->PostMessage(WM_KEYDOWN, VK_RETURN, 0L);
            return true;       // Gobble up the message.
          }
        break;

      default :
        ;
    }  // End of switch
  }
  // Continue normal processing.
  return false;
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:70,代码来源:hlpmanag.cpp


注:本文中的TApplication::GetMainWindow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。