2/2 start.exe: Handle the process title argument (try3)
Alexandre Julliard
julliard at winehq.org
Thu Feb 7 04:58:50 CST 2008
Alexander Nicolaysen Sørnes <alex at thehandofagony.com> writes:
> + vi.dwOSVersionInfoSize = sizeof(vi);
> + GetVersionExW(&vi);
> +
> + /* On Windows 9x start does not have the process title argument.
> + It works such that if the first parameter begins with a double quote ("),
> + it is taken as the process title. Thus 'start "notepad" a' will work on
> + Windows 9x but not NT variants */
> + if(argc > 1 && (vi.dwMajorVersion >= 5 || (vi.dwMajorVersion == 4 && vi.dwPlatformId == 2)))
The right way to check for Win9x is GetVersion() & 0x80000000.
> + {
> + int cmdcount;
> + WCHAR* cmdline = GetCommandLineW();
> + WCHAR** cmdargs = CommandLineToArgvW(cmdline, &cmdcount);
> + WCHAR* pos = cmdline;
> +
> + pos += lstrlenW(cmdargs[0]);
This won't work if the program name is quoted.
--
Alexandre Julliard
julliard at winehq.org
More information about the wine-devel
mailing list