3 * Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 * PROJECT: ReactOS user32.dll
22 * FILE: lib/user32/misc/dde.c
24 * PROGRAMMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
26 * 09-05-2001 CSH Created
29 /* INCLUDES ******************************************************************/
34 #include <rosrtl/devmode.h>
36 /* FUNCTIONS *****************************************************************/
45 PDISPLAY_DEVICE lpDisplayDevice,
49 UNICODE_STRING Device;
50 if ( !RtlCreateUnicodeStringFromAsciiz ( &Device, (PCSZ)lpDevice ) )
52 SetLastError ( ERROR_OUTOFMEMORY );
56 rc = NtUserEnumDisplayDevices (
62 RtlFreeUnicodeString ( &Device );
76 PDISPLAY_DEVICE lpDisplayDevice,
79 UNICODE_STRING Device;
82 RtlInitUnicodeString ( &Device, lpDevice );
84 rc = NtUserEnumDisplayDevices (
90 RtlFreeUnicodeString ( &Device );
104 MONITORENUMPROC lpfnEnum,
107 return NtUserEnumDisplayMonitors ( hdc, lprcClip, lpfnEnum, dwData );
116 EnumDisplaySettingsExA(
117 LPCSTR lpszDeviceName,
119 LPDEVMODEA lpDevMode,
123 UNICODE_STRING DeviceName;
126 if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
128 SetLastError ( ERROR_OUTOFMEMORY );
132 RosRtlDevModeA2W ( &DevModeW, lpDevMode );
134 rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, &DevModeW, dwFlags );
136 RtlFreeUnicodeString ( &DeviceName );
147 EnumDisplaySettingsA(
148 LPCSTR lpszDeviceName,
150 LPDEVMODEA lpDevMode)
152 return EnumDisplaySettingsExA ( lpszDeviceName, iModeNum, lpDevMode, 0 );
161 EnumDisplaySettingsExW(
162 LPCWSTR lpszDeviceName,
164 LPDEVMODEW lpDevMode,
168 UNICODE_STRING DeviceName;
170 RtlInitUnicodeString ( &DeviceName, lpszDeviceName );
172 rc = NtUserEnumDisplaySettings ( &DeviceName, iModeNum, lpDevMode, dwFlags );
174 RtlFreeUnicodeString ( &DeviceName );
185 EnumDisplaySettingsW(
186 LPCWSTR lpszDeviceName,
188 LPDEVMODEW lpDevMode)
190 return EnumDisplaySettingsExW ( lpszDeviceName, iModeNum, lpDevMode, 0 );
227 ChangeDisplaySettingsExA(
228 LPCSTR lpszDeviceName,
229 LPDEVMODEA lpDevMode,
235 UNICODE_STRING DeviceName;
238 if ( !RtlCreateUnicodeStringFromAsciiz ( &DeviceName, (PCSZ)lpszDeviceName ) )
240 SetLastError ( ERROR_OUTOFMEMORY );
241 return DISP_CHANGE_BADPARAM; /* FIXME what to return? */
244 RosRtlDevModeA2W ( &DevModeW, lpDevMode );
246 rc = NtUserChangeDisplaySettings ( &DeviceName, &DevModeW, hwnd, dwflags, lParam );
248 RtlFreeUnicodeString ( &DeviceName );
259 ChangeDisplaySettingsA(
260 LPDEVMODEA lpDevMode,
263 return ChangeDisplaySettingsExA ( NULL, lpDevMode, NULL, dwflags, 0 );
272 ChangeDisplaySettingsExW(
273 LPCWSTR lpszDeviceName,
274 LPDEVMODEW lpDevMode,
280 UNICODE_STRING DeviceName;
282 RtlInitUnicodeString ( &DeviceName, lpszDeviceName );
284 rc = NtUserChangeDisplaySettings ( &DeviceName, lpDevMode, hwnd, dwflags, lParam );
286 RtlFreeUnicodeString ( &DeviceName );
297 ChangeDisplaySettingsW(
298 LPDEVMODEW lpDevMode,
301 return ChangeDisplaySettingsExW ( NULL, lpDevMode, NULL, dwflags, 0 );