diff options
author | Christopher Faylor <me@cgf.cx> | 2000-02-17 19:38:31 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2000-02-17 19:38:31 +0000 |
commit | 369d8a8fd5e887eca547bf34bccfdf755c9e5397 (patch) | |
tree | 5c5dc851bf01a5938662571357ffd5d7bb152a79 /winsup/cygwin/libcmain.cc | |
parent | 4415a7ef3e26c669f5f7c5c7efbf7b6ea9b7e2f4 (diff) | |
download | cygnal-369d8a8fd5e887eca547bf34bccfdf755c9e5397.tar.gz cygnal-369d8a8fd5e887eca547bf34bccfdf755c9e5397.tar.bz2 cygnal-369d8a8fd5e887eca547bf34bccfdf755c9e5397.zip |
import winsup-2000-02-17 snapshot
Diffstat (limited to 'winsup/cygwin/libcmain.cc')
-rw-r--r-- | winsup/cygwin/libcmain.cc | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/winsup/cygwin/libcmain.cc b/winsup/cygwin/libcmain.cc new file mode 100644 index 000000000..a8ae34139 --- /dev/null +++ b/winsup/cygwin/libcmain.cc @@ -0,0 +1,34 @@ +/* libcmain.cc + + Copyright 1996, 1997, 1998 Cygnus Solutions. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#include <windows.h> + +/* Allow apps which don't have a main work, as long as they define WinMain */ +extern "C" int main () +{ + HMODULE x = GetModuleHandleA(0); + char *s = GetCommandLineA (); + STARTUPINFO si; + + /* GetCommandLineA returns the entire command line including the + program name, but WinMain is defined to accept the command + line without the program name. */ + while (*s != ' ' && *s != '\0') + ++s; + while (*s == ' ') + ++s; + + GetStartupInfo (&si); + + WinMain (x, 0, s, + ((si.dwFlags & STARTF_USESHOWWINDOW) != 0 + ? si.wShowWindow + : SW_SHOWNORMAL)); +} |