OSDN Git Service

Avoid unnecessary command line globbing in GUI applications.
[mingw/mingw-get.git] / src / guistub.cpp
1 /*\r
2  * guistub.cpp\r
3  *\r
4  * $Id$\r
5  *\r
6  * Written by Keith Marshall <keithmarshall@users.sourceforge.net>\r
7  * Derived from stub by Sze Howe Koh <axfangli@users.sourceforge.net>\r
8  * Copyright (C) 2011, 2013, MinGW.org Project\r
9  *\r
10  *\r
11  * Implementation of the GUI main program function, which is invoked\r
12  * by the command line start-up stub when invoked without arguments.\r
13  * Alternatively, it may be invoked directly from a desktop shortcut,\r
14  * a launch bar shortcut or a menu entry.  In any of these cases, it\r
15  * causes mingw-get to run as a GUI process.\r
16  *\r
17  *\r
18  * This is free software.  Permission is granted to copy, modify and\r
19  * redistribute this software, under the provisions of the GNU General\r
20  * Public License, Version 3, (or, at your option, any later version),\r
21  * as published by the Free Software Foundation; see the file COPYING\r
22  * for licensing details.\r
23  *\r
24  * Note, in particular, that this software is provided "as is", in the\r
25  * hope that it may prove useful, but WITHOUT WARRANTY OF ANY KIND; not\r
26  * even an implied WARRANTY OF MERCHANTABILITY, nor of FITNESS FOR ANY\r
27  * PARTICULAR PURPOSE.  Under no circumstances will the author, or the\r
28  * MinGW Project, accept liability for any damages, however caused,\r
29  * arising from the use of this software.\r
30  *\r
31  */\r
32 #include <windows.h>\r
33 \r
34 /* We've no use for command line arguments here, so disable globbing;\r
35  * note that this API must be declared 'extern "C"', but the compiler\r
36  * will complain if we declare as such, and initialise with a single\r
37  * statement, so we keep the two concepts separate.\r
38  */\r
39 extern "C" int _CRT_glob;\r
40 int _CRT_glob = 0;\r
41 \r
42 int APIENTRY WinMain\r
43 ( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )\r
44 {\r
45   /* FIXME: this implementation is a stub, adapted from sample code\r
46    * provided by Sze Howe Koh <axfangli@users.sourceforge.net>.  It\r
47    * does no more than display a message box indicating that GUI mode\r
48    * is not yet supported, and directing users to use the CLI version\r
49    * instead.  Ultimately, this will be replaced by a functional GUI\r
50    * implementation.\r
51    */\r
52   MessageBox( NULL,\r
53       "The GUI for mingw-get is not yet available.\n"\r
54       "Please use the command line version; for instructions,\n"\r
55       "invoke\n\n"\r
56 \r
57       "  mingw-get --help\n\n"\r
58 \r
59       "at your preferred CLI prompt.",\r
60       "Feature Unavailable",\r
61       MB_ICONWARNING\r
62     );\r
63   return 0;\r
64 }\r
65 \r
66 /* $RCSfile$: end of file */\r