windows-vista

Forcing my MFC app to run as Administrator on Vista

只愿长相守 提交于 2019-12-10 10:27:18
问题 I have an MFC app built using Visual Studio 2008 and it needs to run on W2K, XP, 2003 and Vista. The application writes to HKLM in the registry and will only work on Vista if you run it as Administrator. My question is: can I force the app to run as Adminstrator automatically? Does it involve creating a manifest file? At the moment I have the following in stdafx.h which I guess creates a manifest file on the fly: #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft

Show UAC prompt when launching an app

狂风中的少年 提交于 2019-12-10 10:20:45
问题 I have an app which needs administrator privileges to do some things. I'd like to just show the UAC prompt when it starts, and then be elevated. I'm not sure how to do this, but I'm hearing about things like manifests and whatnot but not seeing a plain answer anywhere. 回答1: You need an app manifest that demands elevated privileges. Here's a quote from a blog that answers this: First, you can create a manifest file by adding an “Application Manifest File” Item to your project (default name:

Win32 window capture with BitBlt not displaying border

◇◆丶佛笑我妖孽 提交于 2019-12-10 10:18:21
问题 I have written some c++ code to capture a window to a .bmp file. BITMAPFILEHEADER get_bitmap_file_header(int width, int height) { BITMAPFILEHEADER hdr; memset(&hdr, 0, sizeof(BITMAPFILEHEADER)); hdr.bfType = ((WORD) ('M' << 8) | 'B'); // is always "BM" hdr.bfSize = 0;//sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER) + (width * height * sizeof(int)); hdr.bfReserved1 = 0; hdr.bfReserved2 = 0; hdr.bfOffBits = (DWORD)(sizeof(BITMAPFILEHEADER) + sizeof(BITMAPINFOHEADER)); return hdr; }

How to change the “date modified” of any file in Vista home premium? [closed]

耗尽温柔 提交于 2019-12-10 10:15:19
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . In windows vista, how can i change the filed "date modified", of any file(text/binary) without editing it? I mean by just changing some of its properties. In Win-XP if one had to change date of any file(text, binary), in the file properties menu, one could add any string in one of the fields like Author, Comment

Location of %allusersprofile% folder in Windows Vista?

人盡茶涼 提交于 2019-12-10 10:05:09
问题 What is the exact path to %allusersprofile% folder in Windows Vista? On some systems, I have seen the folder as 'c:\Users\All Users', on some it is mapped to 'C:\ProgramData', while on others it has been mapped to 'C:\Users\Public'. If you can provide link to microsoft documentation reference would be highly helpful (so far I have been unable to dig the link out). Edit: Registry settings do define the location of the folder. What I am looking for is more towards how Windows interprets/defines

Start Java Runtime Process with Administrator rights on Vista

给你一囗甜甜゛ 提交于 2019-12-10 06:13:32
问题 i want to execute a setup.exe installer which installes a software on vista with java 1.6. The user is not an administrator. When i try to start the process i get the error message: CreateProcess error=740 which indicates, that the user has not enough rights for starting the process. Can i submit a flag or an option to indicate, the the process should execute with administrator rights? Vista itself does have this functionality inside the menu toolbar. Can i use this function in Java. I call

How to read registry branch HKEY_LOCAL_MACHINE in Vista?

淺唱寂寞╮ 提交于 2019-12-10 05:43:41
问题 I have Application settings stored under HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany branch. Settings must be same for different users and that is the reason why settings are not under HKEY_CURRENT_USER. Registry values are only read during use of application. Now, in Windows Vista and due to UAC you can't anymore use following code to read registry values: RegistryKey myKey = Registry.LocalMachine.CreateSubKey ("SOFTWARE\\MyCompany\\MyAppName"); How can I read the values from LocalMachine branch

Why go 64 bit OS? [closed]

荒凉一梦 提交于 2019-12-10 04:03:23
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . On these questions: Which Vista edition is best for a developer machine? Vista or XP for Dev Machine People are recommending 64 bit, can you explain why? Is it just so you can have more then 3GB of addressable RAM that 32 bit gives you? And how does Visual Studio benefit from all this extra RAM? I went from 64

Turning on Presentation Mode in Windows?

爱⌒轻易说出口 提交于 2019-12-10 03:59:33
问题 Windows Vista has "Presentation Mode", which you can turn on with the Mobility Center. How can I turn it on programmatically? 回答1: The only way I found is to call presentationsettings.exe with /start or /stop directly. I also found this link that describes how to activate presentation mode on desktop PCs: http://www.dubuque.k12.ia.us/it/mobilitycenter/ Hope that helps. 回答2: This seems to fill your need: link text 回答3: This is quite old, but I found this wasn't working from a third party

Unable to Create or Write to a file as standard user

时间秒杀一切 提交于 2019-12-09 23:57:42
问题 My application creates a log file when it connects or disconnects a server. This works well win win XP. There are no issues while I run it as admin in Vista and Win 7. But if I run this as a standard user in Vista or Win7 then it fails to create the log file, and I know this is for UAC. But how can I bypass this situation so that my app will run as admin . DO I need to add any registry entry while installing my application so that it will always run as administrator. 回答1: If you really want