include: The PSDK does not have the A/W variants of MAKEINTATOM() so we should not either.

This commit is contained in:
Francois Gouget 2006-11-08 01:19:02 +01:00 committed by Alexandre Julliard
parent b1602267f0
commit a7f8195be9
15 changed files with 36 additions and 37 deletions

View File

@ -77,8 +77,8 @@ static LRESULT CALLBACK subclass_proc ## N (HWND wnd, UINT msg, \
{ \ { \
LRESULT result; \ LRESULT result; \
ULONG_PTR refData; \ ULONG_PTR refData; \
SetPropW (wnd, MAKEINTATOMW (atSubclassProp), (HANDLE)N); \ SetPropW (wnd, (LPCWSTR)MAKEINTATOM(atSubclassProp), (HANDLE)N); \
refData = (ULONG_PTR)GetPropW (wnd, MAKEINTATOMW (atRefDataProp)); \ refData = (ULONG_PTR)GetPropW (wnd, (LPCWSTR)MAKEINTATOM(atRefDataProp)); \
TRACE ("%d; (%p, %x, %x, %lx, %lx)\n", N, wnd, msg, wParam, lParam, \ TRACE ("%d; (%p, %x, %x, %lx, %lx)\n", N, wnd, msg, wParam, lParam, \
refData); \ refData); \
result = subclasses[N].subclassProc (wnd, msg, wParam, lParam, refData);\ result = subclasses[N].subclassProc (wnd, msg, wParam, lParam, refData);\
@ -173,7 +173,7 @@ void THEMING_Uninitialize (void)
*/ */
LRESULT THEMING_CallOriginalClass (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam) LRESULT THEMING_CallOriginalClass (HWND wnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
INT_PTR subclass = (INT_PTR)GetPropW (wnd, MAKEINTATOMW (atSubclassProp)); INT_PTR subclass = (INT_PTR)GetPropW (wnd, (LPCWSTR)MAKEINTATOM(atSubclassProp));
WNDPROC oldProc = originalProcs[subclass]; WNDPROC oldProc = originalProcs[subclass];
return CallWindowProcW (oldProc, wnd, msg, wParam, lParam); return CallWindowProcW (oldProc, wnd, msg, wParam, lParam);
} }
@ -185,5 +185,5 @@ LRESULT THEMING_CallOriginalClass (HWND wnd, UINT msg, WPARAM wParam, LPARAM lPa
*/ */
void THEMING_SetSubclassData (HWND wnd, ULONG_PTR refData) void THEMING_SetSubclassData (HWND wnd, ULONG_PTR refData)
{ {
SetPropW (wnd, MAKEINTATOMW (atRefDataProp), (HANDLE)refData); SetPropW (wnd, (LPCWSTR)MAKEINTATOM(atRefDataProp), (HANDLE)refData);
} }

View File

@ -570,7 +570,7 @@ ATOM WINAPI RegisterClassExW( const WNDCLASSEXW* wc )
BOOL WINAPI UnregisterClassA( LPCSTR className, HINSTANCE hInstance ) BOOL WINAPI UnregisterClassA( LPCSTR className, HINSTANCE hInstance )
{ {
ATOM atom = HIWORD(className) ? GlobalFindAtomA( className ) : LOWORD(className); ATOM atom = HIWORD(className) ? GlobalFindAtomA( className ) : LOWORD(className);
return UnregisterClassW( MAKEINTATOMW(atom), hInstance ); return UnregisterClassW( (LPCWSTR)MAKEINTATOM(atom), hInstance );
} }
/*********************************************************************** /***********************************************************************

View File

@ -25,13 +25,11 @@
#include "wine/winbase16.h" #include "wine/winbase16.h"
/* Built-in class names (see _Undocumented_Windows_ p.418) */ /* Built-in class names (see _Undocumented_Windows_ p.418) */
#define POPUPMENU_CLASS_ATOMA MAKEINTATOMA(32768) /* PopupMenu */ #define POPUPMENU_CLASS_ATOM MAKEINTATOM(32768) /* PopupMenu */
#define POPUPMENU_CLASS_ATOMW MAKEINTATOMW(32768) /* PopupMenu */ #define DESKTOP_CLASS_ATOM MAKEINTATOM(32769) /* Desktop */
#define DESKTOP_CLASS_ATOM MAKEINTATOMA(32769) /* Desktop */ #define DIALOG_CLASS_ATOM MAKEINTATOM(32770) /* Dialog */
#define DIALOG_CLASS_ATOMA MAKEINTATOMA(32770) /* Dialog */ #define WINSWITCH_CLASS_ATOM MAKEINTATOM(32771) /* WinSwitch */
#define DIALOG_CLASS_ATOMW MAKEINTATOMW(32770) /* Dialog */ #define ICONTITLE_CLASS_ATOM MAKEINTATOM(32772) /* IconTitle */
#define WINSWITCH_CLASS_ATOM MAKEINTATOMA(32771) /* WinSwitch */
#define ICONTITLE_CLASS_ATOM MAKEINTATOMA(32772) /* IconTitle */
/* Built-in class descriptor */ /* Built-in class descriptor */
struct builtin_class_descr struct builtin_class_descr

View File

@ -46,7 +46,7 @@ static LRESULT WINAPI DesktopWndProc( HWND hwnd, UINT message, WPARAM wParam, LP
*/ */
const struct builtin_class_descr DESKTOP_builtin_class = const struct builtin_class_descr DESKTOP_builtin_class =
{ {
DESKTOP_CLASS_ATOM, /* name */ (LPCSTR)DESKTOP_CLASS_ATOM, /* name */
CS_DBLCLKS, /* style */ CS_DBLCLKS, /* style */
NULL, /* procA (winproc is Unicode only) */ NULL, /* procA (winproc is Unicode only) */
DesktopWndProc, /* procW */ DesktopWndProc, /* procW */

View File

@ -95,7 +95,7 @@ typedef struct
*/ */
const struct builtin_class_descr DIALOG_builtin_class = const struct builtin_class_descr DIALOG_builtin_class =
{ {
DIALOG_CLASS_ATOMA, /* name */ (LPCSTR)DIALOG_CLASS_ATOM, /* name */
CS_SAVEBITS | CS_DBLCLKS, /* style */ CS_SAVEBITS | CS_DBLCLKS, /* style */
DefDlgProcA, /* procA */ DefDlgProcA, /* procA */
DefDlgProcW, /* procW */ DefDlgProcW, /* procW */
@ -400,7 +400,7 @@ static LPCSTR DIALOG_ParseTemplate32( LPCSTR template, DLG_TEMPLATE * result )
switch(GET_WORD(p)) switch(GET_WORD(p))
{ {
case 0x0000: case 0x0000:
result->className = DIALOG_CLASS_ATOMW; result->className = (LPCWSTR)DIALOG_CLASS_ATOM;
p++; p++;
break; break;
case 0xffff: case 0xffff:

View File

@ -249,7 +249,7 @@ static LPCSTR DIALOG_ParseTemplate16( LPCSTR p, DLG_TEMPLATE * result )
result->className = p; result->className = p;
TRACE(" CLASS '%s'\n", result->className ); TRACE(" CLASS '%s'\n", result->className );
} }
else result->className = DIALOG_CLASS_ATOMA; else result->className = (LPCSTR)DIALOG_CLASS_ATOM;
p += strlen(p) + 1; p += strlen(p) + 1;
/* Get the window caption */ /* Get the window caption */

View File

@ -45,7 +45,7 @@ static LRESULT WINAPI IconTitleWndProc( HWND hWnd, UINT msg, WPARAM wParam, LPAR
*/ */
const struct builtin_class_descr ICONTITLE_builtin_class = const struct builtin_class_descr ICONTITLE_builtin_class =
{ {
ICONTITLE_CLASS_ATOM, /* name */ (LPCSTR)ICONTITLE_CLASS_ATOM, /* name */
0, /* style */ 0, /* style */
NULL, /* procA (winproc is Unicode only) */ NULL, /* procA (winproc is Unicode only) */
IconTitleWndProc, /* procW */ IconTitleWndProc, /* procW */
@ -67,11 +67,11 @@ HWND ICONTITLE_Create( HWND owner )
if (!IsWindowEnabled(owner)) style |= WS_DISABLED; if (!IsWindowEnabled(owner)) style |= WS_DISABLED;
if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD ) if( GetWindowLongA( owner, GWL_STYLE ) & WS_CHILD )
hWnd = CreateWindowExA( 0, ICONTITLE_CLASS_ATOM, NULL, hWnd = CreateWindowExA( 0, (LPCSTR)ICONTITLE_CLASS_ATOM, NULL,
style | WS_CHILD, 0, 0, 1, 1, style | WS_CHILD, 0, 0, 1, 1,
GetParent(owner), 0, instance, NULL ); GetParent(owner), 0, instance, NULL );
else else
hWnd = CreateWindowExA( 0, ICONTITLE_CLASS_ATOM, NULL, hWnd = CreateWindowExA( 0, (LPCSTR)ICONTITLE_CLASS_ATOM, NULL,
style, 0, 0, 1, 1, style, 0, 0, 1, 1,
owner, 0, instance, NULL ); owner, 0, instance, NULL );
WIN_SetOwner( hWnd, owner ); /* MDI depends on this */ WIN_SetOwner( hWnd, owner ); /* MDI depends on this */

View File

@ -189,7 +189,7 @@ DWORD WINAPI DrawMenuBarTemp(HWND hwnd, HDC hDC, LPRECT lprect, HMENU hMenu, HFO
*/ */
const struct builtin_class_descr MENU_builtin_class = const struct builtin_class_descr MENU_builtin_class =
{ {
POPUPMENU_CLASS_ATOMA, /* name */ (LPCSTR)POPUPMENU_CLASS_ATOM, /* name */
CS_DROPSHADOW | CS_SAVEBITS | CS_DBLCLKS, /* style */ CS_DROPSHADOW | CS_SAVEBITS | CS_DBLCLKS, /* style */
NULL, /* procA (winproc is Unicode only) */ NULL, /* procA (winproc is Unicode only) */
PopupMenuWndProc, /* procW */ PopupMenuWndProc, /* procW */
@ -1826,7 +1826,7 @@ static BOOL MENU_ShowPopup( HWND hwndOwner, HMENU hmenu, UINT id,
if( y < info.rcWork.top ) y = info.rcWork.top; if( y < info.rcWork.top ) y = info.rcWork.top;
/* NOTE: In Windows, top menu popup is not owned. */ /* NOTE: In Windows, top menu popup is not owned. */
menu->hWnd = CreateWindowExW( 0, POPUPMENU_CLASS_ATOMW, NULL, menu->hWnd = CreateWindowExW( 0, (LPCWSTR)POPUPMENU_CLASS_ATOM, NULL,
WS_POPUP, x, y, width, height, WS_POPUP, x, y, width, height,
hwndOwner, 0, (HINSTANCE)GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE), hwndOwner, 0, (HINSTANCE)GetWindowLongPtrW(hwndOwner, GWLP_HINSTANCE),
(LPVOID)hmenu ); (LPVOID)hmenu );

View File

@ -2037,7 +2037,7 @@ static void SPY_GetClassName( SPY_INSTANCE *sp_e )
/* save and restore error code over the next call */ /* save and restore error code over the next call */
save_error = GetLastError(); save_error = GetLastError();
/* special code to detect a property sheet dialog */ /* special code to detect a property sheet dialog */
if ((GetClassLongW(sp_e->msg_hwnd, GCW_ATOM) == (LONG)WC_DIALOGW) && if ((GetClassLongW(sp_e->msg_hwnd, GCW_ATOM) == WC_DIALOG) &&
(GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) { (GetPropW(sp_e->msg_hwnd, PropSheetInfoStr))) {
strcpyW(sp_e->wnd_class, WC_PROPSHEETW); strcpyW(sp_e->wnd_class, WC_PROPSHEETW);
} }

View File

@ -1961,7 +1961,7 @@ static void test_window_tree(HWND parent, const DWORD *style, const int *order,
{ {
if (style[i] & DS_CONTROL) if (style[i] & DS_CONTROL)
{ {
child[i] = CreateWindowExA(0, MAKEINTATOMA(32770), "", style[i] & ~WS_VISIBLE, child[i] = CreateWindowExA(0, MAKEINTATOM(32770), "", style[i] & ~WS_VISIBLE,
0,0,0,0, parent, (HMENU)i, 0, NULL); 0,0,0,0, parent, (HMENU)i, 0, NULL);
if (style[i] & WS_VISIBLE) if (style[i] & WS_VISIBLE)
ShowWindow(child[i], SW_SHOW); ShowWindow(child[i], SW_SHOW);

View File

@ -54,7 +54,7 @@ HRESULT WINAPI EnableThemeDialogTexture(HWND hwnd, DWORD dwFlags)
HRESULT hr; HRESULT hr;
TRACE("(%p,0x%08x\n", hwnd, dwFlags); TRACE("(%p,0x%08x\n", hwnd, dwFlags);
hr = SetPropW (hwnd, MAKEINTATOMW (atDialogThemeEnabled), hr = SetPropW (hwnd, (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled),
(HANDLE)(dwFlags|0x80000000)); (HANDLE)(dwFlags|0x80000000));
/* 0x80000000 serves as a "flags set" flag */ /* 0x80000000 serves as a "flags set" flag */
if (FAILED(hr)) if (FAILED(hr))
@ -75,7 +75,7 @@ BOOL WINAPI IsThemeDialogTextureEnabled(HWND hwnd)
TRACE("(%p)\n", hwnd); TRACE("(%p)\n", hwnd);
dwDialogTextureFlags = (DWORD)GetPropW (hwnd, dwDialogTextureFlags = (DWORD)GetPropW (hwnd,
MAKEINTATOMW (atDialogThemeEnabled)); (LPCWSTR)MAKEINTATOM(atDialogThemeEnabled));
if (dwDialogTextureFlags == 0) if (dwDialogTextureFlags == 0)
/* Means EnableThemeDialogTexture wasn't called for this dialog */ /* Means EnableThemeDialogTexture wasn't called for this dialog */
return TRUE; return TRUE;

View File

@ -606,13 +606,13 @@ HRESULT WINAPI EnableTheming(BOOL fEnable)
*/ */
HRESULT UXTHEME_SetWindowProperty(HWND hwnd, ATOM aProp, LPCWSTR pszValue) HRESULT UXTHEME_SetWindowProperty(HWND hwnd, ATOM aProp, LPCWSTR pszValue)
{ {
ATOM oldValue = (ATOM)(size_t)RemovePropW(hwnd, MAKEINTATOMW(aProp)); ATOM oldValue = (ATOM)(size_t)RemovePropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp));
if(oldValue) if(oldValue)
DeleteAtom(oldValue); DeleteAtom(oldValue);
if(pszValue) { if(pszValue) {
ATOM atValue = AddAtomW(pszValue); ATOM atValue = AddAtomW(pszValue);
if(!atValue if(!atValue
|| !SetPropW(hwnd, MAKEINTATOMW(aProp), (LPWSTR)MAKEINTATOMW(atValue))) { || !SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp), (LPWSTR)MAKEINTATOM(atValue))) {
HRESULT hr = HRESULT_FROM_WIN32(GetLastError()); HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
if(atValue) DeleteAtom(atValue); if(atValue) DeleteAtom(atValue);
return hr; return hr;
@ -623,7 +623,7 @@ HRESULT UXTHEME_SetWindowProperty(HWND hwnd, ATOM aProp, LPCWSTR pszValue)
LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer, int dwLen) LPWSTR UXTHEME_GetWindowProperty(HWND hwnd, ATOM aProp, LPWSTR pszBuffer, int dwLen)
{ {
ATOM atValue = (ATOM)(size_t)GetPropW(hwnd, MAKEINTATOMW(aProp)); ATOM atValue = (ATOM)(size_t)GetPropW(hwnd, (LPCWSTR)MAKEINTATOM(aProp));
if(atValue) { if(atValue) {
if(GetAtomNameW(atValue, pszBuffer, dwLen)) if(GetAtomNameW(atValue, pszBuffer, dwLen))
return pszBuffer; return pszBuffer;
@ -656,7 +656,7 @@ HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList); hTheme = MSSTYLES_OpenThemeClass(pszAppName, pszUseClassList);
} }
if(IsWindow(hwnd)) if(IsWindow(hwnd))
SetPropW(hwnd, MAKEINTATOMW(atWindowTheme), hTheme); SetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme), hTheme);
TRACE(" = %p\n", hTheme); TRACE(" = %p\n", hTheme);
return hTheme; return hTheme;
} }
@ -675,7 +675,7 @@ HTHEME WINAPI OpenThemeData(HWND hwnd, LPCWSTR pszClassList)
HTHEME WINAPI GetWindowTheme(HWND hwnd) HTHEME WINAPI GetWindowTheme(HWND hwnd)
{ {
TRACE("(%p)\n", hwnd); TRACE("(%p)\n", hwnd);
return GetPropW(hwnd, MAKEINTATOMW(atWindowTheme)); return GetPropW(hwnd, (LPCWSTR)MAKEINTATOM(atWindowTheme));
} }
/*********************************************************************** /***********************************************************************

View File

@ -454,9 +454,12 @@ typedef struct _PROCESS_HEAP_ENTRY
#define INVALID_ATOM ((ATOM)0) #define INVALID_ATOM ((ATOM)0)
#define MAXINTATOM 0xc000 #define MAXINTATOM 0xc000
#define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom)))) #ifdef __WINESRC__
#define MAKEINTATOMW(atom) ((LPCWSTR)((ULONG_PTR)((WORD)(atom)))) /* force using a cast when inside Wine */
#define MAKEINTATOM WINELIB_NAME_AW(MAKEINTATOM) #define MAKEINTATOM(atom) ((ULONG_PTR)((WORD)(atom)))
#else
#define MAKEINTATOM(atom) ((LPTSTR)((ULONG_PTR)((WORD)(atom))))
#endif
typedef struct tagMEMORYSTATUS typedef struct tagMEMORYSTATUS
{ {

View File

@ -1439,9 +1439,7 @@ typedef struct tagSTYLESTRUCT {
DWORD styleNew; DWORD styleNew;
} STYLESTRUCT, *LPSTYLESTRUCT; } STYLESTRUCT, *LPSTYLESTRUCT;
#define WC_DIALOGA MAKEINTATOMA(0x8002) #define WC_DIALOG MAKEINTATOM(0x8002)
#define WC_DIALOGW MAKEINTATOMW(0x8002)
#define WC_DIALOG WINELIB_NAME_AW(WC_DIALOG)
/* Offsets for GetWindowLong() and GetWindowWord() */ /* Offsets for GetWindowLong() and GetWindowWord() */
#define GWL_EXSTYLE (-20) #define GWL_EXSTYLE (-20)

View File

@ -28,7 +28,7 @@
WINE_DEFAULT_DEBUG_CHANNEL(explorer); WINE_DEFAULT_DEBUG_CHANNEL(explorer);
#define DESKTOP_CLASS_ATOM MAKEINTATOMW(32769) #define DESKTOP_CLASS_ATOM ((LPCWSTR)MAKEINTATOM(32769))
#define DESKTOP_ALL_ACCESS 0x01ff #define DESKTOP_ALL_ACCESS 0x01ff
static BOOL using_root; static BOOL using_root;