blob: c4f02949db04ccfe829b1e656d26f07e3e06fca7 [file] [log] [blame]
Bram Moolenaaredf3f972016-08-29 22:49:24 +02001/* vi:set ts=8 sts=4 sw=4 noet:
Bram Moolenaar071d4272004-06-13 20:20:40 +00002 *
3 * VIM - Vi IMproved by Bram Moolenaar
4 * GUI support by Robert Webb
5 *
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
9 */
10/*
11 * Windows GUI: main program (EXE) entry point:
12 *
Bram Moolenaarb26705a2019-04-02 22:02:32 +020013 * Ron Aaron <ronaharon@yahoo.com> wrote this and the (now deleted) DLL support
14 * code.
Bram Moolenaar071d4272004-06-13 20:20:40 +000015 */
16#include "vim.h"
17
Bram Moolenaarb26705a2019-04-02 22:02:32 +020018// cproto doesn't create a prototype for VimMain()
Bram Moolenaarafde13b2019-04-28 19:46:49 +020019#ifdef VIMDLL
20__declspec(dllimport)
21#endif
Bram Moolenaareae1b912019-05-09 15:12:55 +020022int VimMain(int argc, char **argv);
Bram Moolenaarafde13b2019-04-28 19:46:49 +020023#ifndef VIMDLL
Bram Moolenaareae1b912019-05-09 15:12:55 +020024void SaveInst(HINSTANCE hInst);
Bram Moolenaar071d4272004-06-13 20:20:40 +000025#endif
26
Bram Moolenaarb26705a2019-04-02 22:02:32 +020027#ifndef PROTO
Bram Moolenaar796cc422019-04-03 20:31:00 +020028# ifdef FEAT_GUI
Bram Moolenaar071d4272004-06-13 20:20:40 +000029 int WINAPI
Bram Moolenaar796cc422019-04-03 20:31:00 +020030wWinMain(
Bram Moolenaarb26705a2019-04-02 22:02:32 +020031 HINSTANCE hInstance,
Bram Moolenaar1266d672017-02-01 13:43:36 +010032 HINSTANCE hPrevInst UNUSED,
Bram Moolenaar796cc422019-04-03 20:31:00 +020033 LPWSTR lpszCmdLine UNUSED,
Bram Moolenaar1266d672017-02-01 13:43:36 +010034 int nCmdShow UNUSED)
Bram Moolenaar796cc422019-04-03 20:31:00 +020035# else
36 int
37wmain(int argc UNUSED, wchar_t **argv UNUSED)
38# endif
Bram Moolenaar071d4272004-06-13 20:20:40 +000039{
Bram Moolenaarafde13b2019-04-28 19:46:49 +020040# ifndef VIMDLL
41# ifdef FEAT_GUI
Bram Moolenaarb26705a2019-04-02 22:02:32 +020042 SaveInst(hInstance);
Bram Moolenaarafde13b2019-04-28 19:46:49 +020043# else
44 SaveInst(GetModuleHandleW(NULL));
45# endif
Bram Moolenaarb26705a2019-04-02 22:02:32 +020046# endif
Bram Moolenaar796cc422019-04-03 20:31:00 +020047 VimMain(0, NULL);
Bram Moolenaar071d4272004-06-13 20:20:40 +000048
49 return 0;
50}
51#endif