From 5e2f50f8c06e8f73c45076430c8e339890b2ed9c Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Sun, 7 Nov 1999 22:26:20 +0000 Subject: [PATCH] Added ChangeDisplaySettingsExA stub and some flag defines. --- include/winuser.h | 17 +++++++++++++++++ relay32/user32.spec | 2 +- windows/user.c | 39 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 56 insertions(+), 2 deletions(-) diff --git a/include/winuser.h b/include/winuser.h index eada59064ba..009b18cccdf 100644 --- a/include/winuser.h +++ b/include/winuser.h @@ -1202,6 +1202,17 @@ typedef struct { #define DISP_CHANGE_BADMODE (-2) #define DISP_CHANGE_NOTUPDATED (-3) #define DISP_CHANGE_BADFLAGS (-4) +#define DISP_CHANGE_BADPARAM (-5) + +/* ChangeDisplaySettings.dwFlags */ +#define CDS_UPDATEREGISTRY 0x00000001 +#define CDS_TEST 0x00000002 +#define CDS_FULLSCREEN 0x00000004 +#define CDS_GLOBAL 0x00000008 +#define CDS_SET_PRIMARY 0x00000010 +#define CDS_RESET 0x40000000 +#define CDS_SETRECT 0x20000000 +#define CDS_NORESET 0x10000000 /* flags to FormatMessage */ #define FORMAT_MESSAGE_ALLOCATE_BUFFER 0x00000100 @@ -3019,6 +3030,12 @@ LRESULT WINAPI CallWindowProcA(WNDPROC,HWND,UINT,WPARAM,LPARAM); LRESULT WINAPI CallWindowProcW(WNDPROC,HWND,UINT,WPARAM,LPARAM); #define CallWindowProc WINELIB_NAME_AW(CallWindowProc) BOOL WINAPI ChangeClipboardChain(HWND,HWND); +LONG WINAPI ChangeDisplaySettingsA(LPDEVMODEA,DWORD); +LONG WINAPI ChangeDisplaySettingsW(LPDEVMODEW,DWORD); +#define ChangeDisplaySettings WINELIB_NAME_AW(ChangeDisplaySettings) +LONG WINAPI ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPARAM); +LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPARAM); +#define ChangeDisplaySettingsEx WINELIB_NAME_AW(ChangeDisplaySettingsEx) BOOL WINAPI ChangeMenuA(HMENU,UINT,LPCSTR,UINT,UINT); BOOL WINAPI ChangeMenuW(HMENU,UINT,LPCWSTR,UINT,UINT); #define ChangeMenu WINELIB_NAME_AW(ChangeMenu) diff --git a/relay32/user32.spec b/relay32/user32.spec index 305bfebb572..9c597bb71fd 100644 --- a/relay32/user32.spec +++ b/relay32/user32.spec @@ -606,7 +606,7 @@ init MAIN_UserInit 601 stub WNDPROC_CALLBACK 602 stdcall DrawCaptionTempW(long long ptr long long wstr long) DrawCaptionTempW 603 stub IsHungAppWindow -604 stub ChangeDisplaySettingsExA +604 stdcall ChangeDisplaySettingsExA(str ptr long long ptr) ChangeDisplaySettingsExA 605 stub ChangeDisplaySettingsExW 606 stdcall SetWindowText(long str) SetWindowTextA 607 stdcall GetMonitorInfoA(long ptr) GetMonitorInfoA diff --git a/windows/user.c b/windows/user.c index 672783b2747..bda9b03fd6f 100644 --- a/windows/user.c +++ b/windows/user.c @@ -322,13 +322,50 @@ BOOL WINAPI ExitWindowsEx( UINT flags, DWORD reserved ) return FALSE; } +static void _dump_CDS_flags(DWORD flags) { +#define X(x) if (flags & CDS_##x) MESSAGE(""#x ","); + X(UPDATEREGISTRY);X(TEST);X(FULLSCREEN);X(GLOBAL); + X(SET_PRIMARY);X(RESET);X(SETRECT);X(NORESET); +#undef X +} /*********************************************************************** * ChangeDisplaySettingA (USER32.589) */ LONG WINAPI ChangeDisplaySettingsA( LPDEVMODEA devmode, DWORD flags ) { - FIXME_(system)(": stub\n"); + FIXME_(system)("(%p,0x%08lx), stub\n",devmode,flags); + MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n"); + if (devmode==NULL) + FIXME_(system)(" devmode=NULL (return to default mode)\n"); + else if ( (devmode->dmBitsPerPel != DESKTOP_GetScreenDepth()) + || (devmode->dmPelsHeight != DESKTOP_GetScreenHeight()) + || (devmode->dmPelsWidth != DESKTOP_GetScreenWidth()) ) + + { + + if (devmode->dmFields & DM_BITSPERPEL) + FIXME_(system)(" bpp=%ld\n",devmode->dmBitsPerPel); + if (devmode->dmFields & DM_PELSWIDTH) + FIXME_(system)(" width=%ld\n",devmode->dmPelsWidth); + if (devmode->dmFields & DM_PELSHEIGHT) + FIXME_(system)(" height=%ld\n",devmode->dmPelsHeight); + FIXME_(system)(" (Putting X in this mode beforehand might help)\n"); + /* we don't, but the program ... does not need to know */ + return DISP_CHANGE_SUCCESSFUL; + } + return DISP_CHANGE_SUCCESSFUL; +} + +/*********************************************************************** + * ChangeDisplaySettingExA (USER32.604) + */ +LONG WINAPI ChangeDisplaySettingsExA( + LPCSTR devname, LPDEVMODEA devmode, HWND hwnd, DWORD flags, + LPARAM lparam +) { + FIXME_(system)("(%s,%p,0x%04x,0x%08lx,0x%08lx), stub\n",devname,devmode,hwnd,flags,lparam); + MESSAGE("\tflags=");_dump_CDS_flags(flags);MESSAGE("\n"); if (devmode==NULL) FIXME_(system)(" devmode=NULL (return to default mode)\n"); else if ( (devmode->dmBitsPerPel != DESKTOP_GetScreenDepth())