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


C++ CWinApp::WinHelpInternal方法代码示例

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


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

示例1: OnCommandHelp

LRESULT CFrameWnd::OnCommandHelp( WPARAM wParam, LPARAM lParam )
/**************************************************************/
{
    UNUSED_ALWAYS( wParam );
    
    if( lParam == 0L ) {
        if( IsTracking() ) {
            lParam = HID_BASE_COMMAND + m_nIDTracking;
        } else if( m_nIDHelp != 0 ) {
            lParam = HID_BASE_RESOURCE + m_nIDHelp;
        } else {
            return( FALSE );
        }
    }
    
    CWinApp *pApp = AfxGetApp();
    if( pApp != NULL ) {
        pApp->WinHelpInternal( lParam );
    }
    return( TRUE );
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:21,代码来源:framewnd.cpp

示例2: OnContextHelp

void CFrameWnd::OnContextHelp()
/*****************************/
{
    if( !m_bHelpMode && CanEnterHelpMode() ) {
        m_bHelpMode = TRUE;
        ::SetCursor( _HelpCursor );
        
        UINT nIDOld = (UINT)::SendMessage( m_hWnd, WM_SETMESSAGESTRING,
                                           AFX_IDS_HELPMODEMESSAGE, 0L );
        if( nIDOld == 0 ) {
            nIDOld = AFX_IDS_IDLEMESSAGE;
        }
        
        CWinApp *pApp = AfxGetApp();
        ASSERT( pApp != NULL );
        
        MSG         msg;
        LONG        lCount = 0L;
        DWORD_PTR   dwHelpId = 0L;
        for( ;; ) {
            while( !::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) ) {
                if( pApp->OnIdle( lCount ) ) {
                    lCount++;
                } else {
                    ::WaitMessage();
                }
            }
            ::GetMessage( &msg, NULL, 0, 0 );
            if( msg.message == WM_EXITHELPMODE ) {
                break;
            } else if( msg.message == WM_KEYDOWN && msg.wParam == VK_ESCAPE ) {
                break;
            } else if( (msg.message >= WM_KEYFIRST && msg.message <= WM_KEYLAST) ||
                       msg.message == WM_SYSCOMMAND ) {
                if( !pApp->PreTranslateMessage( &msg ) ) {
                    ::TranslateMessage( &msg );
                    if( msg.message != WM_SYSKEYDOWN && msg.message != WM_SYSKEYUP &&
                        msg.message != WM_SYSCHAR && msg.message != WM_SYSDEADCHAR &&
                        msg.message != WM_SYSCOMMAND ) {
                        continue;
                    }
                }
            } else if( msg.message == WM_LBUTTONDOWN ||
                       msg.message == WM_NCLBUTTONDOWN ) {
                int nHitTest = (int)::SendMessage( msg.hwnd, WM_NCHITTEST, 0,
                                                   MAKELPARAM( msg.pt.x, msg.pt.y ) );
                if( nHitTest == HTCLIENT ) {
                    HWND hWnd = msg.hwnd;
                    while( hWnd != NULL && dwHelpId == 0L ) {
                        CPoint point( msg.pt );
                        ::ScreenToClient( hWnd, &point );
                        dwHelpId = (DWORD_PTR)::SendMessage( hWnd, WM_HELPHITTEST, 0,
                                                             MAKELPARAM( point.x,
                                                                         point.y ) );
                        hWnd = ::GetParent( hWnd );
                    }
                    break;
                } else if( nHitTest >= 0 && nHitTest != HTMENU &&
                           nHitTest != HTSYSMENU ) {
                    dwHelpId = HID_BASE_NCAREAS + nHitTest;
                    break;
                }
            }
            ::DispatchMessage( &msg );
        }
        m_bHelpMode = FALSE;
        ::SendMessage( m_hWnd, WM_SETMESSAGESTRING, nIDOld, 0L );

        POINT point;
        ::GetCursorPos( &point );

        HWND hWndCursor = ::WindowFromPoint( point );
        if( hWndCursor != NULL ) {
            int nHitTest = (int)::SendMessage( hWndCursor, WM_NCHITTEST, 0,
                                                 MAKELPARAM( point.x, point.y ) );
            ::SendMessage( hWndCursor, WM_SETCURSOR, (WPARAM)hWndCursor,
                           MAKELPARAM( nHitTest, WM_MOUSEMOVE ) );
        } else {
            HCURSOR hCursor = ::LoadCursor( NULL, IDC_ARROW );
            ::SetCursor( hCursor );
        }

        if( dwHelpId != 0L ) {
            pApp->WinHelpInternal( dwHelpId );
        }
    }
}
开发者ID:ArmstrongJ,项目名称:open-watcom-v2,代码行数:87,代码来源:framewnd.cpp


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