Get rid of W->A calls

Robert Shearman R.J.Shearman at
Fri Sep 5 12:16:29 CDT 2003

> -----Original Message-----
> From: wine-devel-admin at [mailto:wine-devel-admin at]On
> Behalf Of Dimitrie O. Paun
> Sent: 05 September 2003 17:40
> To: hatky at
> Cc: wine-devel at
> Subject: Re: Get rid of W->A calls
> > why did they call them wcommand in WinHelpA and
> > command in WinHelpW ?? (msdn calls them uCommand but
> > the code uses wcommand...)
> I don't see why, it should be named the same in
> both versions if it's encoding independent.

I think the confusing thing is the 'w' prefix. In this case 'w' stands for
WORD, i.e. a two-byte integer. Also, MSDN isn't clear as to whether it is
encoding independent but I would assume so.

> > -hDest = FindWindowA("MS_WINHELP", NULL);
> > +hDest = FindWindowW("MS_WINHELP", NULL);
> You can't to that directly, as we don't support
> Unicode literals. You need to do that by hand:
>     WCHAR clsName[] = { 'M', 'S', '_', 'W', 'I', 'N', 'H', 'E',
> 'L', 'P', 0 };
>     hDest = FindWindowW(clsName, NULL);

This would be better:

static const WCHAR clsName[]...

It allows for better optimization by the compiler (assuming that the
compiler can't work out that clsName will not be modified) and shows the
purpose better to the next person who looks at it.


More information about the wine-devel mailing list