Graphics and Multimedia Topics include: GDI+, drawing 2D/3D, printing and Managed DirectX and the XNA Framework

Enjoy an ad free experience by logging in. Not a member yet? Register.
Go Back  Xtreme .NET Talk > .NET > Graphics and Multimedia > Re: VB.NET --> Screen Resolution Change Example Complete!

Thread Tools Display Modes
Old 04-28-2010, 09:18 AM
camps22 camps22 is offline
Join Date: Apr 2010
Posts: 1
camps22 is on a distinguished road
Default Re: VB.NET --> Screen Resolution Change Example Complete!

Split from

it works like a charm for me in 8 different pcs, wonderful code, as we say in my country of origin, "¡te vaciaste!" ("you emptied yourself!") however one pc, at home, HP Pavilion Elite DT 2.50GHz, 1 Terabyte, windows 7, lresult = -2, change failed, why? might it be a authorization issue? how can i grant permission to change resolution? thank you.

Last edited by snarfblam; 04-28-2010 at 01:55 PM. Reason: New questions or replies to very old topics should go in a new thread with a link to the old. Thanks!
Reply With Quote
Old 04-28-2010, 02:00 PM
snarfblam's Avatar
snarfblam snarfblam is offline
Ultimate Contributor

Preferred language:
C#, VB
Join Date: Jun 2003
Location: USA
Posts: 2,097
snarfblam will become famous soon enough
Default Re: VB.NET --> Screen Resolution Change Example Complete!

The documentation from MSDN explains the parameters and, more importantly, the return value.

The -2 is DISP_CHANGE_BADMODE (from via google).

MSDN states that this return value indicates:
An invalid set of flags was passed in
Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.NET --> Screen Resolution Change Example Complete! joshuaand Interoperation / Office Integration 11 07-06-2011 07:29 AM
Screen Resolution - Detect Change In Toby Twerl Windows Forms 2 04-16-2010 11:08 AM
Change screen resolution with vb. net? AlexMesquita Windows Forms 2 01-12-2004 12:17 AM
screen resolution change cartque Graphics and Multimedia 1 07-02-2003 09:07 AM
api screen resolution change malooga General 1 02-13-2003 06:58 PM


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..