Get rid of W->A calls
Dimitrie O. Paun
dimi at intelliware.ca
Fri Sep 5 11:39:58 CDT 2003
On Fri, 5 Sep 2003, hatky wrote:
> Ok, lets take another one, winhelp.c WinHelpW->A
OK, I have to warn you I haven't looked at the code,
so I'll just go by what I see in this email.
> I take whatever is in WinHelpA and move it into
> WinHelpW with the fallowing changes:
>
> -BOOL WINAPI WinHelpW( HWND hWnd, LPCWSTR helpFile,
> UINT command, ULONG_PTR dwData )
> +BOOL WINAPI WinHelpW( HWND hWnd, LPCWSTR helpFile,
> UINT wcommand, ULONG_PTR dwData )
>
> 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.
> -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);
> - if (!(hDest = FindWindowA("MS_WINHELP",
> NULL)))
> + if (!(hDest = FindWindowW("MS_WINHELP",
> NULL)))
Ditto, just do
if (!(hDest = FindWindowW(clsName, NULL);
> - return SendMessageA(hDest, WM_COPYDATA,
> (WPARAM)hWnd, (LPARAM)&cds);
> + return SendMessageW(hDest, WM_COPYDATA,
> (WPARAM)hWnd, (LPARAM)&cds);
OK.
> and now I need to put a call in WinHelpA to WinHelpW
> after converting
> LPCSTR lpHelpFile
> ?
Yes.
--
Dimi.
More information about the wine-devel
mailing list