window| resolution in Windows to achieve different users have different resolution can actually do-it-yourself to achieve, look at the following examples:
First, make a C # program that can change the screen resolution, the source code is as follows, using the Vs.net 1:
1, new Windows Application project, named Screenresolution
2, paste the files of the code:
Program.cs
--------------------------------------------------------------------------------
#region Using directives
Using System;
Using System.Collections.Generic;
Using System.Windows.Forms;
#endregion
Namespace Screenresolution
{
Static Class Program
{
<summary>
The main entry point is for the application.
</summary>
[STAThread]
static void Main ()
{
Application.enablevisualstyles ();
Application.enablertlmirroring ();
Application.Run (New Form1 ());
}
}
}
Using System;
Using System.Drawing;
Using System.Collections;
Using System.ComponentModel;
Using System.Windows.Forms;
Using System.Data;
Using System.Runtime.InteropServices;
[StructLayout (layoutkind.sequential, CharSet = CharSet.Auto)]
struct DEVMODE
{
public const int dm_displayfrequency = 0x400000;
public const int dm_pelswidth = 0x80000;
public const int dm_pelsheight = 0x100000;
Private Const int cchdevicename = 32;
Private Const int cchformname = 32;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = cchdevicename)]
public string Dmdevicename;
public short dmspecversion;
public short dmdriverversion;
public short dmsize;
public short Dmdriverextra;
public int dmfields;
public int Dmpositionx;
public int dmpositiony;
Public Dmdo dmdisplayorientation;
public int dmdisplayfixedoutput;
public short Dmcolor;
public short Dmduplex;
public short dmyresolution;
public short dmttoption;
public short dmcollate;
[MarshalAs (UnmanagedType.ByValTStr, SizeConst = cchformname)]
public string dmFormName;
public short dmlogpixels;
public int Dmbitsperpel;
public int dmpelswidth;
public int dmpelsheight;
public int dmdisplayflags;
public int dmdisplayfrequency;
public int dmicmmethod;
public int dmicmintent;
public int dmmediatype;
public int dmdithertype;
public int dmReserved1;
public int dmReserved2;
public int dmpanningwidth;
public int dmpanningheight;
}
[DllImport ("user32.dll", CharSet = CharSet.Auto)]
static extern int changedisplaysettings (DEVMODE lpdevmode, int dwflags);
3, in the Design view of the Windowsstate set to Minimized,showintaskbar set to False
Second, according to the needs of each user to modify the Changeres method in the resolution settings, build the project to put the executable file in this user's Startup folder
Summarize:
The principle of the program is very simple, when the user log in to set the resolution to the user's expectations, the program is always running before the user log out, but users will not be aware, in the user login, the program is terminated, the resolution is set back to a specific value, so as to achieve a unified logon resolution and each user has its own resolution.
Improved:
If you have more users, you can change the screen resolution by program parameters, avoid multiple generation of projects and generate confusion of several versions.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.