windows-7

Get RAM system size

烈酒焚心 提交于 2019-12-10 14:07:56
问题 I would like to know how can I get the size of my RAM through C++ (on Windows 7). 回答1: Use GetPhysicallyInstalledSystemMemory to retrieve the amount of RAM that is physically installed on the computer. (Note that this requires Windows Vista SP1 or later. The function is not available on earlier versions of the Windows operating system.) The remarks on MSDN say: The GetPhysicallyInstalledSystemMemory function retrieves the amount of physically installed RAM from the computer's SMBIOS firmware

Can't list some folders

旧城冷巷雨未停 提交于 2019-12-10 13:58:15
问题 I'm getting an "Access denied" exception when trying to list some folders on my PC, such as 'c:\Documents and Settings'. My application is running from an administrator account and with elevated privileges ( <requestedExecutionLevel level="requireAdministrator" uiAccess="false" /> ) What else I need to do to access such folders? 回答1: Running as administrator is necessary, but not enough, you also need to enable the Backup privilege, as implicitely documented here: Junction Points %SystemDrive

ERROR_BAD_LENGTH when calling Process32First in Windows 7

会有一股神秘感。 提交于 2019-12-10 13:38:09
问题 I just tried to revoke some old code from Windows XP which generates a list of all running processes, but it failed on Windows 7. Before I continue, here's the code: #include <windows.h> #include <tlhelp32.h> int main() { HANDLE hSnap, hTemp; PROCESSENTRY32 pe; hSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); if(Process32First(hSnap, &pe)) { do { ... } } while(Process32Next(hSnap, &pe)); } ... } I checked which function failed and it turned out that it's Process32First. GetLastError()

matplotlib 1.3.0 ImportError: DLL load failed: %1 is not a valid Win32 application

╄→гoц情女王★ 提交于 2019-12-10 13:37:35
问题 I have 2 pc (laptop and workstation), when I run code for version check I get on laptop: computer LAPTOP OS props Windows-7-6.1.7601-SP1 python props ('default', 'May 15 2013 22:44:16') python version 2.7.5 OS bit and OS type ('64bit', 'WindowsPE') check if system is 32bit or 64bit ('7fffffffffffffff', True) numpy version 1.7.1 matplotlib version 1.3.0 and on workstation: computer WORKSTATION OS props Windows-7-6.1.7601-SP1 python props ('default', 'May 15 2013 22:44:16') python version 2.7.5

allocating ram shows double the ram usage in task manager

别说谁变了你拦得住时间么 提交于 2019-12-10 13:23:46
问题 Doing some profiling (mem & speed) I've been stomped by the fact that win7 seems to be allocating exactly double the RAM I ask for... Note this is the first time I do such active profiling on win7, so I don't really know what to expect. I'm allocating precise amounts of RAM in a loop using an express edition of MSVC under win7 (64-bit). The application is compiled and runs in 32 bit. I allocate 24 MB of ram and the task manager shows my app as using 48MB (under all memory columns, including

Reading Registry in Windows 7 behaving strangely

北战南征 提交于 2019-12-10 13:17:29
问题 I am trying to read registry's "(Default)" values in Windows 7 in c++, and following is the code I am using: string GetSZValueUnique( HKEY openKey, const char* regkey, const char* keyName ) { HKEY hKey = 0; BYTE data[512] ; DWORD szsize = 512 ; string value ; LONG retValue = RegOpenKeyEx( openKey, regkey, 0, KEY_READ, &hKey ) ; if ( retValue == ERROR_SUCCESS ) { LONG retV = RegQueryValueEx( hKey, keyName, 0, 0, data, &szsize ) ; if ( retV == ERROR_SUCCESS ) { char* _value = reinterpret_cast

Android adb doesnt recognize Samsung Galaxy S (I9000) on Windows 7 64 bit

拜拜、爱过 提交于 2019-12-10 13:15:20
问题 Has anyone been successful with hooking up a Samsung Galaxy S (I9000) with ADB running on Win 7? Links to already existing threads or tutorials related to this would be much appreciated! Thanks! 回答1: I've done it - no problems Win7/64Bit. Can't give you an exact link, but can tell you how to get the right driver. Go to the Samsung Mobile Innovator site and a little way down is a green button titled "Download: SAMSUNG_USB_Driver_for_Mobile_Phones.exe". This simply worked for me for both both

Delphi, installers and Windows 7

喜欢而已 提交于 2019-12-10 12:55:56
问题 As part of a general move to Windows 7 - where all applications should have an "installer experience", I need to create installers for all of our application suite. I have looked at InstallShield, but this seems extremely expensive for what it does. What install products could I look at? The installers will need to be built unattended on our build machines, so there is a level of complexity above just being an installer builder. Update: I have looked at all of the suggestions and they look

Can't uninstall Python 3.4.2 from Windows 7 after system restore

我与影子孤独终老i 提交于 2019-12-10 12:53:37
问题 A couple of days after uninstalling Python 3.4.2 I had to carry out a system restore (I'm using Windows 7) due to accidentally installing a bunch of rubbish-ware that was messing with my computer even after installation. This system restore effectively "reinstalled" Python, or rather a broken version of it. I now can't uninstall it via the usual Control Panel -> Uninstall Programs tool, nor can I reinstall it using the original installer. Unfortunately Windows has not saved an earlier system

Stop “explorer” process completely using PowerShell

我的未来我决定 提交于 2019-12-10 12:52:15
问题 Greeting, I'm trying to stop "explorer" process using power-shell command: Stop-Process -ProcessName explorer -Force the problem with that line, it will stop the process but it will run again automatically so it just restarting the process not stopping it. Please advice me how to stop "explorer" process completely using power-shell Regards, 回答1: You can do this ( though I don't know why you wouldn't want explorer to come back): taskkill /F /IM explorer.exe 回答2: Set the AutoRestartShell DWord