1 件の投稿を表示中 (合計 1 個)
  • 作成者
    投稿
  • #6036
    Yutaka Emura
    キーマスター

    このマクロを C++ (またはよく使う設定) の設定のプロパティで F1 キーに割り当てておくと便利です。
    dexplore.jsee (JavaScript for EmEditor)

    // Displays keyword at cursor with Microsoft Document Explorer 2008 (shipped with Visual Studio 2008 or MSDN)
    // It will become extremely useful if you assign this macro to the F1 key
    // in C++ (or your choice) configuration properties in EmEditor.
    //
    function Link( sKeyword )
    {
    // Run Document Explorer or activate if already running.
    var viewer = GetObject( “”, “DExplore.AppObj.9.0” ); // “.9.0” in case of Visual Studio 2008. Change this number to another version if needed.
    var helpHost = viewer.Help;
    helpHost.SetCollection(“ms-help://ms.vscc.v90”, “(unfiltered)”); // the first parameter specifies the collection, the second parameter specifies the filter (can be “Visual C++”, etc.).
    try {
    helpHost.DisplayTopicFromF1Keyword( sKeyword );
    helpHost.SyncIndex( sKeyword, 1 );
    }
    catch (e) { }
    }

    var sKeyword;
    if( document.selection.IsEmpty ){ // select word if none selected
    x = document.selection.GetActivePointX( eePosLogical );
    y = document.selection.GetActivePointY( eePosLogical );
    document.selection.SelectWord();
    sKeyword = document.selection.Text;
    document.selection.SetActivePoint( eePosLogical, x, y );
    }
    else {
    sKeyword = document.selection.Text; // used currently selected text if already selected
    }
    Link( sKeyword );

1 件の投稿を表示中 (合計 1 個)
  • このトピックに返信するにはログインしてください。