[PATCH] msinfo32: Display an About dialog when the program is run.

Alex Henrie alexhenrie24 at gmail.com
Tue Oct 4 09:34:08 CDT 2016


2016-10-04 3:06 GMT-06:00 Hugh McMaster <hugh.mcmaster at outlook.com>:
> On Monday, 3 October 2016 5:14 PM, Alex Henrie wrote:
>
>> msinfo32 does not take any command line arguments, so I changed
>> WINE_FIXME to WINE_TRACE.
>
> No. msinfo32 accepts many command line arguments. See, for example, https://support.microsoft.com/en-au/kb/300887.

Thanks, I should have googled it. I ran `msinfo32 /?` and when nothing
appeared on the console, I assumed that the program had no command
line mode. I see now that the /? switch actually opened a help window.

>> +#include <shlwapi.h>
>> +
>> +#include "resource.h"
>> +#include "shellapi.h"
>>  #include "wine/debug.h"
>
> resource.h should come after wine/debug.h. You might also like to put shellapi.h before shlwapi.h.

Okay, will do.

>> int wmain(int argc, WCHAR *argv[])
>> {
>> +    static const WCHAR wineSystemInfoW[] =
>> +        {'W','i','n','e',' ','S','y','s','t','e','m',' ','I','n','f','o','r','m','a','t','i','o','n',0};
>> +    WCHAR systemInfo[64];
>>     int i;
>>
>> -    WINE_FIXME("stub:");
>>     for (i = 0; i < argc; i++)
>> -        WINE_FIXME(" %s", wine_dbgstr_w(argv[i]));
>> -    WINE_FIXME("\n");
>> +        WINE_TRACE(" %s", wine_dbgstr_w(argv[i]));
>> +    WINE_TRACE("\n");
>> +
>> +    LoadStringW(GetModuleHandleW(NULL), STRING_SYSTEM_INFO, systemInfo, sizeof(systemInfo)/sizeof(WCHAR));
>> +    ShellAboutW(NULL, systemInfo, wineSystemInfoW, NULL);
>
> The dialog box text should also be translatable. Add it to the string table as well.

I modeled this after Notepad, where "Wine Notepad" is not
translatable. After looking at more examples, I think I'd prefer to
make the third parameter NULL.

>> +#include "resource.h"
>> +
>> +STRINGTABLE
>> +{
>> +    STRING_SYSTEM_INFO, "System Information"
>> +}
>
>> +#define STRING_SYSTEM_INFO 0x170
>
> Why #define this as 0x170? We normally start string tables from, e.g., 100, 101, 1000 or 1001.

Also modeled after Notepad, where this string happens to be 0x170.
I'll change it to 100.

-Alex



More information about the wine-devel mailing list