windows-7

How to get OS language using C++ API?

狂风中的少年 提交于 2019-12-18 17:36:31
问题 I am in the process of developing a application which displays dialogs depending on the OS language. How I can get the OS language using C++ or Windows APIs (Windows 2008/Vista/7)? 回答1: There are several functions to do this in Windows, depending on what format you want the information in. Prior to Windows Vista, the language information was encoded into a LCID (Locale Id) which includes language, as well as some information about sorting and formatting. For Windows Vista and Windows 7, a

ReadProcessMemory fails on some Pages (GetLastError()=299)

泄露秘密 提交于 2019-12-18 17:31:54
问题 I try to read all commited pages of a process (Win7-64). On most pages it works but it fails for a few pages. I cannot explain why. Here is my test programme (compiled x32, tested in Win7-64): #include <windows.h> void main() { HANDLE hProc = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION,FALSE,GetCurrentProcessId()); SYSTEM_INFO si; ZeroMemory(&si,sizeof(SYSTEM_INFO)); GetSystemInfo(&si); char* buf = new char[si.dwPageSize]; for (unsigned i = 0; i < 0x7fff0; i++) { void* baseOffs =

Windows Firewall, Tinywall and GIT

别说谁变了你拦得住时间么 提交于 2019-12-18 17:30:57
问题 Just finally updated to Win7 from XP. I am using Windows Firewall with added Tinywall (gives more control) But when I use Git Bash, the firewall blocks all commands. If I disable the firewall then everything works OK I cannot figure the proper exceptions to add to TinyWall whitelist. I added the shell window as well as the git.exe for application exceptions but still no go. These exceptions program paths I added: C:\Program Files (x86)\Git\git-cheetah\..\bin\sh.exe C:\Program Files (x86)\Git

Can I get write access to raw disk sectors under Vista and Windows 7 in user mode?

流过昼夜 提交于 2019-12-18 16:59:32
问题 From the RawDisk website: The new security model of Windows Vista puts tight restrictions on applications executed in user mode. Even with elevated administrative rights, the application can’t get write access to raw disk sectors. Is this true? From the Microsoft doc: The changes to the file system and to the storage stack do not apply if the volume is not mounted or if the volume has no file system. Please give either a link to the official Microsoft doc confirming the RawDisk website or a

SD card files updated programmatically are not updated in windows explorer

会有一股神秘感。 提交于 2019-12-18 16:57:10
问题 My application does file operations on the SD card (delete or update file). But when I connect the device to Windows 7 through USB, I do not see any changes. However I can confirm files where updated or deleted with adb shell. I use an ASUS eee Pad with Android 3.0. It seems devices running Android 3.0 have a different way to provide access to the file system (MTP instead of USB Mass Storage). I also read about how we can use MediaScannerConnection.scanFile to refresh the content of Windows

Delphi: How to use ShowWindow properly on external application [duplicate]

感情迁移 提交于 2019-12-18 16:56:30
问题 This question already has an answer here : How can I make the second instance of my program pass control back to the first instance? (1 answer) Closed 5 years ago . See also: How can I tell if another instance of my program is already running? i use the following code before starting my application, to check if another instance of it is already started: var _PreviousHandle : THandle; begin _PreviousHandle := FindWindow('TfrmMainForm',nil); if _PreviousHandle <> 0 then begin ShowMessage(

C# Windows7/Vista style ListView

て烟熏妆下的殇ゞ 提交于 2019-12-18 15:48:32
问题 when I create a ListView in details view in VS2008, it creates a rather old looking listview. It doesnt have any of the fancy hover effects and cool blue border that (for example) the file explorer in WinVista and Win7 has. See image for example: So to summarise, how can I get a ListView in C# VS2008 look like the one in the picture above? (VS2008 listview on the right for comparison) Thanks 回答1: Try calling SetWindowTheme Like this: [DllImport("uxtheme.dll", ExactSpelling=true, CharSet

How to execute unix commands through Windows/cygwin using Java

故事扮演 提交于 2019-12-18 15:32:14
问题 I am trying to accomplish two things: I am running cygwin on Windows7 to execute my unix shell commands and I need to automate the process by writing a Java app. I already know how to use the windows shell through Java using the 'Process class' and Runtime.getRuntime().exec("cmd /c dir") . I need to be able to do the same with unix commands: i.e.: ls -la and so forth. What should I look into? Is there a way to remember a shell's state? explanation: when I use: Runtime.getRuntime().exec("cmd

Installing SQLite 3.6 On Windows 7

纵饮孤独 提交于 2019-12-18 14:49:15
问题 How do I install SQLite 3.6 on Windows 7? I extracted sqlite3.exe, sqlite3.dll, and sqlite3.def to C:\Windows\System32 but when I try to run a Ruby program that requires the use of sqlite3, I get this error: The program can't start because sqlite3.dll is missing from your computer. Try reinstalling the program to fix this problem. 回答1: I would try adding the path to SQLite in PATH. Supplemental: SQLite 3 is not "installed". It's a DLL, usually unregistered. Most software using SQLite 3 will

Installing SQLite 3.6 On Windows 7

混江龙づ霸主 提交于 2019-12-18 14:49:07
问题 How do I install SQLite 3.6 on Windows 7? I extracted sqlite3.exe, sqlite3.dll, and sqlite3.def to C:\Windows\System32 but when I try to run a Ruby program that requires the use of sqlite3, I get this error: The program can't start because sqlite3.dll is missing from your computer. Try reinstalling the program to fix this problem. 回答1: I would try adding the path to SQLite in PATH. Supplemental: SQLite 3 is not "installed". It's a DLL, usually unregistered. Most software using SQLite 3 will