WINEFILE: Eliminate use of windowsx.h

Robert Shearman rob at
Sun Mar 19 06:40:06 CST 2006

Mike McCormack wrote:

> Robert Shearman wrote:
>>> Despite containing some useful macros, those macros are somewhat
>>> broken as they are ignorant of UNICODE, so cannot be "fixed" by simple
>>> conversion to inline functions.
>> Unicode isn't a problem as "void *" could simply be used, but there are
>> other compatibility reasons why inline functions shouldn't be used.
> Using the following example:
> #define ComboBox_AddString(hwndCtl, lpsz) \
>         ((int)SendMessage((hwndCtl), CB_ADDSTRING, 0L, 
> (LPARAM)(LPCTSTR)(lpsz)))
> In Wine source, UNICODE is not defined.  So should the above be using 
> SendMessageW/LPCWSTR or SendMessageA/LPCSTR?

Either "void *" as I mentioned above or only the LPARAM cast for Wine 
source files, and LPCTSTR still for Winelib.

> Furthermore, using an inline function requires that we've included 
> winuser.h to get the definition of SendMessageA/W, whereas windowsx.h 
> on its own doesn't require that.
> The commctrl.h macros don't have this problem as they define A/W 
> versions of the macros.  I am in the process of adding inline 
> functions to commctrl.h, and will submit a patch for that soon.

Well, I guess I am relieved that you're not putting an #error at the top 
of the include file like you did with windowsx.h.

Rob Shearman

More information about the wine-devel mailing list