windows-vista

Programmatically prevent Windows screensaver from starting

点点圈 提交于 2019-11-27 12:44:11
Is there a recommended way to prevent the Windows screensaver from starting? The closest thing I've found is this article , but what I would really like to do is just tell Windows that the computer isn't idle rather than fooling with the currently set screensaver values. For testing, I set the screensaver to 1 minute and required a password. I tried capturing SC_SCREENSAVE and returning -1 in VB .Net. As commented, it works when there is no screensaver password but fails if the screensaver password is active. (I tried it in Windows XP). I also put this into a Timer's tick event, every 1000

Process.Start with different credentials with UAC on

大憨熊 提交于 2019-11-27 12:28:36
I am trying to start another process with Process.Start running under different credentials with the UAC turned on. I get the following error: System.ComponentModel.Win32Exception: Logon failure: user account restriction. Possible reasons are blank passwords not allowed, logon hour restrictions, or a policy restriction has been enforced at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at System.Diagnostics.Process.Start(ProcessStartInfo startInfo) If I turn off UAC, it works fine. If I start the process without specifying

How can I detect if my process is running UAC-elevated or not?

隐身守侯 提交于 2019-11-27 11:53:51
My Vista application needs to know whether the user has launched it "as administrator" (elevated) or as a standard user (non-elevated). How can I detect that at run time? For those of us working in C#, in the Windows SDK there is a "UACDemo" application as a part of the "Cross Technology Samples". They find if the current user is an administrator using this method: private bool IsAdministrator { get { WindowsIdentity wi = WindowsIdentity.GetCurrent(); WindowsPrincipal wp = new WindowsPrincipal(wi); return wp.IsInRole(WindowsBuiltInRole.Administrator); } } (Note: I refactored the original code

How can I programmatically refresh Windows Explorer?

霸气de小男生 提交于 2019-11-27 11:42:44
I have a Windows shell extension that uses IShellIconOverlayIdentifier interface to display overlay icons on files and folders. My extension is a little like TortoiseCVS or TortoiseSVN . Sometimes I need to make Windows Explorer redraw all it's icons. To do this, I call SHChangeNotify like this: SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL) This refreshes the desktop and right hand pane of any open explorer windows. It doesn't refresh the folder tree on the left hand side of any Explorer windows. So I tried sending WM_SETTINGCHANGE like this: SendMessage(HWND_BROADCAST, WM

How can I/O priority of a process be increased?

别说谁变了你拦得住时间么 提交于 2019-11-27 11:20:39
问题 I want to increase the I/O priority of a process. Answers for both .NET and Windows Vista would be nice. processexplorer is ok as well. 回答1: The relevant information seems to be a bit scattered compared to the usual MS documentation. There is this white paper that discusses I/O Prioritization in windows. This doc seems to have beta flags all over it but I guess it's probably mostly pretty accurate. Two important things to note: You can only reduce the priority of IO requests below normal. The

Node.Js on windows - How to clear console

泪湿孤枕 提交于 2019-11-27 11:04:21
Being totally new into node.js environment and philosophy i would like answers to few questions. I had downloaded the node.js for windows installer and also node package manager.Windows Cmd prompt is being currently used for running nodejs apps. cls clears the command window or errors in command prompt. Is there a equivalent for node.js ? console.clear does not exist ;( or does it in some other form? I created a server through this code below var http = require("http"); http.createServer(function (request, response) { response.writeHead(200, { "Content-Type": "text/html" }); response.write(

Chrome Style C# Applications?

风流意气都作罢 提交于 2019-11-27 09:54:35
问题 I'm not talking about the vista glass feature, I already know how to accomplish that. The feature that I'm talking about is add controls to the titlebar, like office 2007 does with the logo and toolbar. 回答1: You need to do some Win32 interop to achieve that effect. Depending on whether you are using Winforms or WPF, the way you hook to the message processing differs (I don't remember Winforms, so I'll give all examples for WPF). But in both cases, you need to: Intercept the creation of the

How to connect pyodbc to an Access (.mdb) Database file

為{幸葍}努か 提交于 2019-11-27 09:32:30
Here's what I've tried: -Find Vista's ODBC Data Source Manager* through search, -Add a new File Data Source*, selecting Driver for Microsoft Access (*.mdb), and selecting my mdb file of interest, -import pyodbc from python shell and try: pyodbc.connect("DSN=<that Data Source I just created>") I get the following error message (Portuguese**): Error: ('IM002', '[IM002] [Microsoft][ODBC Driver Manager] Nome da fonte de dados n\xe3o encontrado e nenhum driver padr\xe3o especificado (0) (SQLDriverConnectW)') Which translates as "Data source name not found and no standard driver specified". What am

cron jobs or PHP scheduler

久未见 提交于 2019-11-27 09:19:17
I am using MYSQL as my database and PHP as my programming language.I wanted to run a cron job which would run until the current system date matches the "deadline(date)" column in my database table called "PROJECT".Once the dates are same an update query has to run which would change the status(field of project table) from "open" to "close". I am not really sure if cron jobs are the best way or I could use triggers or may be something else.Also I am using Apache as my web server and my OS is windows vista. Also which is the best way to do it? PHP scheduler or cron jobs or any other method? can

How to prevent Vista from requiring elevation on patch.exe?

只愿长相守 提交于 2019-11-27 09:14:15
[I'm sorry that this isn't directly a programming question. But I have recently switched to a new Vista machine where I am keeping UAC enabled (please don't tell me to disable it, it's not an option).] Every time I run gnu's patch.exe I get an elevation dialog from Vista. If I rename patch.exe to foo.exe it does not do this, so I assume this is one of Vista's "heuristics". Does anyone know how to disable this? It's driving me nuts and the Googles aren't helping. Or should I add a manifest just for patch.exe to tell the system NOT to try to elevate this? Will that work, and if so how do you