Issue with ChangeDisplaySettingsEx().

I have an utility which will change the position of the secondry monitor and other attributes.wht i noticed that if i change the secondry monitor position,the secondry monitor screen reset and all the window over the secondry monitor moved to primary.
can someone please help to resolve this issue.

flags = DisplayModes.CDS_UPDATEREGISTRY | DisplayModes.CDS_GLOBAL |DisplayModes.CDS_FULLSCREEN;

tempDD.dm.dmFields |= (DisplayModes.DM_POSITION |DisplayModes.DM_BITSPERPEL | DisplayModes.DM_PELSWIDTH | DisplayModes.DM_PELSHEIGHT);

DisplayModes.ChangeDisplaySettingsEx(tempDD.dispDevName.ToString(), ref tempDD.dm, (IntPtr)null, flags, (IntPtr)null);

whether i need to mention any additional paramters/settings in the above mentioned function?

Thanks in adavce

What OS are you seeing this on? This is expected behavior when the 2ndary monitor resets. It becomes invalid for a short period of time and all windows are moved off of it.

d

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com] On Behalf Of xxxxx@rediffmail.com
Sent: Monday, August 17, 2009 11:29 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Issue with ChangeDisplaySettingsEx().

I have an utility which will change the position of the secondry monitor and other attributes.wht i noticed that if i change the secondry monitor position,the secondry monitor screen reset and all the window over the secondry monitor moved to primary.
can someone please help to resolve this issue.

flags = DisplayModes.CDS_UPDATEREGISTRY | DisplayModes.CDS_GLOBAL |DisplayModes.CDS_FULLSCREEN;

tempDD.dm.dmFields |= (DisplayModes.DM_POSITION |DisplayModes.DM_BITSPERPEL | DisplayModes.DM_PELSWIDTH | DisplayModes.DM_PELSHEIGHT);

DisplayModes.ChangeDisplaySettingsEx(tempDD.dispDevName.ToString(), ref tempDD.dm, (IntPtr)null, flags, (IntPtr)null);

whether i need to mention any additional paramters/settings in the above mentioned function?

Thanks in adavce


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online at http://www.osronline.com/page.cfm?name=ListServer

Hi Doron,

Thanks for quick reply.I am testing on windows 7 os.The issue is not happening with other third party applications like ultraMon.Its happening only wiht my utility.

What is the value of dmposition.X and dmPosition.y. dmposition.X should be X
lengtho of primary monitor + 1;

Anshul Makkar

On Tue, Aug 18, 2009 at 1:02 PM, wrote:

> Hi Doron,
>
> Thanks for quick reply.I am testing on windows 7 os.The issue is not
> happening with other third party applications like ultraMon.Its happening
> only wiht my utility.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>