Change resolution..

I tried to change screen resolution with my project(by using API)
then, it works find.

and i wanted to know if there's any difference from when i change resolution with display settings(on the desktop).

So, i printed all message happening.

As I checked both occurs different message.

the way with my code occurs 647.. something, but the other way with display settings occurs nothing.

(just in case, i put some code I did)


Question.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
DISPLAY_DEVICE dd = GetPrimaryDevice();
	DEVMODE dm;
	dm.dmSize = sizeof(DEVMODE);
	if (!EnumDisplaySettings(dd.DeviceName, ENUM_CURRENT_SETTINGS, &dm))
	{
		printf("EnumDisplaySettings failed:%d\n", GetLastError());
		return FALSE;
	}

	dm.dmPelsWidth = PelsWidth;
	dm.dmPelsHeight = PelsHeight;
	dm.dmFields = (DM_PELSWIDTH | DM_PELSHEIGHT);
	if (ChangeDisplaySettings(&dm, CDS_TEST) !=DISP_CHANGE_SUCCESSFUL)
	{
		printf("\nIllegal graphics mode: %d\n", GetLastError());
		return FALSE;
	}

	return (ChangeDisplaySettings(&dm, 0)==DISP_CHANGE_SUCCESSFUL);


How can I change resolution like using display settings??

Thanks.
Topic archived. No new replies allowed.