File: e_win32.cpp

package info (click to toggle)
fte 0.50.2b6-20110708-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 3,768 kB
  • ctags: 6,761
  • sloc: cpp: 47,985; ansic: 2,795; sh: 112; makefile: 71; perl: 29
file content (47 lines) | stat: -rw-r--r-- 1,255 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*    e_win32.cpp
 *
 *    Copyright (c) 1997, Marko Macek
 *
 *    You may distribute under the terms of either the GNU General Public
 *    License or the Artistic License, as specified in the README file.
 *
 */

// Win32 (NT) specific routines

#include "fte.h"
#include "c_bind.h"
#include "i_view.h"
#include "c_history.h"
#include "s_util.h"
#include "i_modelview.h"

// Silence warnings about redefinition, we don't need this here anyway.
#undef SEARCH_ALL

#include <windows.h>

int EView::SysShowHelp(ExState &State, const char *word) {
    char file[MAXPATH] = "";

    if (State.GetStrParam(this, file, sizeof(file) - 1) == 0)
        if (MView->Win->GetStr("Help file",
                               sizeof(file) - 1, file, HIST_DEFAULT) == 0)
            return 0;

    char wordAsk[64] = "";
    if (word == 0) {
        if (State.GetStrParam(this, wordAsk, sizeof(wordAsk) - 1) == 0)
            if (MView->Win->GetStr("Keyword",
                                   sizeof(wordAsk) - 1, wordAsk, HIST_DEFAULT) == 0)
                return 0;
        word = wordAsk;
    }

    //** Start WinHelp,
    if (!WinHelp(0, file, HELP_KEY, (DWORD)word)) {
        Msg(S_ERROR, "Failed to start WinHelp!");
        return 0;
    }
    return 1;
}