473,394 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Another SystemParametersInfo question

I need to disable the screen saver, due to an Excel "bug".

I thought I had the following code working, but now all I get is code 127.
I've searched the net and I don't see anything wrong with the following.
[DllImport("user32.dll", CharSet=CharSet.Auto, SetLastError=true)]
public static extern int SystemParametersInfo(int uiAction, int uiParam,
string pvParam, int fuWinIni);

static void Main()
{
const int SPI_SETSCREENSAVEACTIVE = 17;
int screenStatus;
int retCode = 0 ;
screenStatus = 0; // disable screen saver
retCode = SystemParametersInfo (SPI_SETSCREENSAVEACTIVE, 0, "0",0);
if (retCode == 0 )
retCode = Marshal.GetLastWin32Error ();
MessageBox.Show ("Screen saver not turned off","Screen Saver"); //Deactivate
screen saver
}

Thanks
Dwight
Nov 16 '05 #1
2 1789
Dwight

I'm having the same problem.

Did you find a solution to your problem?
User submitted from AEWNET (http://www.aewnet.com/)
Nov 16 '05 #2
Dwight

I'm also having the same problem - did you find a solution to stop getting the 127 error?

Please let me know if you have a solution

Darre

User submitted from AEWNET (http://www.aewnet.com/)
Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
6
by: Mike S. | last post by:
I'm using a SystemParametersInfo call to attempt to manage the screen saver. All I want to do is modify the ScreenSaveActive bit in the registry and have the OS recognize it (and occasionally set...
2
by: philippe.joliet | last post by:
Hello, I'm currently try to use the SystemParametersInfo function in a c# environnement but I have a problem to use it with the action SPI_SETWORKAREA I've got this definition private...
1
by: Mohammad-Reza | last post by:
In SystemParametersInfo API, type of its pvParam is PVOID. I want to know what type I must use to both set and get of this api works properly.
2
by: GTi | last post by:
I need the csharp (C#) function for this API function: SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0); Or must I pInvoke this (also)? My biggest problem with C# is to find the C# function...
1
by: kenwhale | last post by:
hi, all. In my computer(windows2000 professional), I found this code doesn't work! SystemParametersInfo(0x2000/*SPI_GETFOREGROUNDLOCKTIMEOUT*/,0,&dwTimeOut,0)) ; The value of dwTimeOut...
3
by: Shamil Salakhetdinov | last post by:
Hi All, I did try by myself and I did search on google but I can't find any info on how to use SystemParametersInfo Win32API in VB.NET Any useful samples, hints, tips & tricks will be greatly...
1
by: David | last post by:
Hi, I'm trying to use SystemParametersInfo to get the desktop work area: Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Integer,...
1
by: BigWilli | last post by:
Hello, I want to change the keyboard language. Does anyone have an example code in VB6 for that? I know already from MSDN that it should be possible with the SystemParametersInfo and the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.