How to Use systemparametersinfo

Source: Internet
Author: User

 

 

[Dllimport ("user32.dll", entrypoint = "systemparametersinfo")]

Public static extern int systemparametersinfo (

Int uaction,

Int uparam,

String lpvparam,

Int fuwinini

);

 

 

Parameters: Meaning
Uaction Long: Specifies the parameter to be set. Refer to the uaction constant table.
Uparam Long, refer to the uaction constant table
Lpvparam Any: the integer, long, and data structure called by reference.
Fuwinini This parameter specifies whether to update user-defined parameters when setting system parameters.

 

Below are some uaction parameters and their usage methods:

 

 
Parameters Meaning and usage
6 Set the window size, systemparametersinfo (6, zoom in and out, P, 0), and lpvparam to long
17 Enable screensaver, systemparametersinfo (17, false, P, 1), and uparam is Boolean
13, 24 Changes the horizontal and vertical spacing of desktop icons. uparam is the spacing value (pixel), and lpvparam is the long type.
15 Set the screen saver wait time, systemparametersinfo (15, seconds, P, 1), and lpvparam to long
20 Set the desktop background wallpaper, systemparametersinfo (20, true, image path, 1)
93 Switch the mouse track. If systemparametersinfo (93, numeric value, P, 1) and uparam is false, disable it.
97 Switch CTRL + ALT + DEL window, systemparametersinfo (97, false, A, 0), uparam is Boolean


 
  • Spi_seticontitlelogfont lpvparam is a logfont structure used to define the font used by the icon title. Uparam specifies the size of the logfont structure. If both are null, use the font spi_setkeyboarddelay uparam defined at system startup to indicate the duplicate latency of the new keyboard.

  • If the value of spi_setkeyboardpref is true, it indicates that the user prefers the former compared with the keyboard and mouse. Refer to spi_getkeyboardpref

  • Spi_setkeyboardspeed uparam indicates the new keyboard repetition rate

  • Spi_setlangtoggle enables the window to reload the hotkey information from the system registry for exchange between keyboard la s

  • If spi_setlowpoweractive uparam is set to true, the screen saver mode is enabled. Applicable only to Win95

  • Spi_setlowpowertimeout uparam represents the latency of the new energy-saving screen saver. Applicable only to Win95

  • When spi_setmenudropalignment uparam is set to false, the left alignment of the pop-up menu is set. If it is true, the right alignment is set.

  • The parameter spi_setminimizedmetrics is the same as that of spi_getminimizedmetrics.

  • Spi_setmouse lpvparam is the first entry of a three-element integer array, which contains the mouse settings. Refer to spi_getmouse

  • If the value of spi_setmousebuttonswap uparam is true, the left and right mouse buttons are switched. If the value is false, the original value is used.

  • The parameter spi_setmousekeys is the same as that of spi_getmousekeys.

  • The parameter spi_setnonclientmetrics is the same as the parameter spi_getnonclientmetrics.

  • When spi_setpenwindows uparam is true, load the pen window. If it is false, uninstall

  • If the value of spi_setpoweroffactive uparam is true, screen protection mode is enabled. Applicable only to Win95

  • Spi_setpowerofftimeout uparam represents the latency of the screen saver for new power outages. Applicable only to Win95

  • When spi_setscreenreader uparam is set to true, a screen reading program is running. Refer to spi_getscreenreader

  • If spi_setscreensaveactive uparam is set to true, the screen saver is activated. If false, the screen saver is disabled.

  • Spi_setscreensavetimeout uparam indicates the New Screen Protection delay time, in seconds

  • The spi_setserialkeys parameter is the same as the spi_getserialkeys parameter.

  • When spi_setshowsounds uparam is set to true, the window is allowed to enable the sound prompt feature. Refer to spi_getshowsounds

  • Spi_setsnaptodefbutton if the mouse should automatically move to the default button in the new dialog box, uparam is true. Applicable only to NT 4.0

  • Spi_setsoundsentry is the same as spi_getsoundsentry.

  • Spi_setstickykeys is the same as spi_getstickykeys.

  • Spi_settogglekeys is the same as spi_gettogglekeys.

  • Spi_setworkarea is the same as spi_getworkarea.

Systemparametersinfo 97,-1, 0, 0' all keys locked
Systemparametersinfo 97, 0, 0, 0' restore keyboard lock

 

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.