windows

Sparse files in WinXP SP3

Suddenly, we found out that WinXP SP3 didn't allow to create NTFS sparse file in user-mode application. Namely, DeviceIoControl with FSCTL_SET_SPARSE returns with error 0x57 (ERROR_INVALID_PARAMETER). The same code works well in SP2. Also, it's all ok if make the same calls from kernel-mode (both in SP3 and SP2). Google says nothing abo...

MFC - execute code right after dialog is shown (.NET equivalent of Form.Shown)

I'm doing some small changes to C++ MFC project. I'm .NET developer so Windows programming is new to me. I need to launch some method right after CDialog is completely shown (painted) for the first time, but only once. How can I do this? In .NET I would handle Form.Shown event. Do I need to handle some message? Which? Do I need to ove...

Emacs and cygwin

How can I change my GNUemacs to open up a cygwin terminal rather then a cmd one with the shell command? Closed as duplicate of How can I run Cygwin Bash Shell from within Emacs?. ...

Autocomplete in MySQL under Windows

Does anybody know if there is a way to make autocompletion work in MySQL Command Line Client under Windows? It's working nicely under Linux for me, but simply moves the cursor under Windows instead. ...

Regex in awk and WinGrep

So I'm looking for a pattern like this: size='0x0' in a log file - but I'm only interested in large sizes (4 digits or more). The following regex works great in EditPadPro (nice tool BTW) size='0x[0-9a-fA-F]{4,} But the same regex does not work in awk - seems like the repetition {4,} is messing it up. Same with WinGrep - any idea fr...

Best Place to Store Config Files and Log Files on Windows for My Program?

I need to store log files and config files for my application. Where is the best place to store them? Right now I'm just using the current directory, which ends up putting them in the Program Files directory where my program lives. The log files will probably be accessed by the user somewhat regularly, so %APPDATA% seems a little hard...

Best LaTeX editor for Windows

I'm looking for a good LaTeX editor for Windows! ...

Locate the path of an Apache server on windows.

For a windows script I am writing, I need to detect if the machine has Apache 2.2 installed, and to find the application path. One solution I came up with is to wget http://localhost:8080/server-info and parse the root and the config file from it. This would fail if the server does not use port 8080 Another option would be to call “s...

Embedding .Net Runtime

Am I able to embed the .net runtime so that .net is not required on the host operating system? I was looking at doing this with Mono by looking here: http://mono-project.com/Embedding_Mono but seems to allude to using external modules to accomplish this. My goal is to have one single executable with no installed .net runtime. I do not ...

In Windows, how can I launch cygwin shells n times and then resize their windows?

My hope is to one-click a shortcut, and get a grid of cygwin shells laid out before me, filling up my whole screen. Any idea where I should start looking? ...

.Net 3.5 Windows Forms Application: x86 vs x64 load times on 64 bit Vista

We are developing a Winforms application and in the process of optimizing the start-up time. The app runs on 64 bit Vista machines. In our testing we found what seems like a counter intuitive result. All else equal, targeting 32-bit vs 64-bit loads in half the time. Can anyone shed some light as to why? Thanks. [Edit] We deploy the...

Run a script when either locking or unlocking Windows XP

I have a Windows XP machine and a Linux machine running Ubuntu. I share the keyboard/mouse from the Windows machine via Synergy. What I would like to do is lock/unlock the Linux machine whenever I lock/unlock the Windows machine. So I'd like to be able to run a script of some description when Windows either locks or unlocks the screen. ...

In Windows, how do I run a shortcut into the background from a command prompt?

cmd /C "myshortcut1.lnk" cmd /C "myshortcut2.lnk" Works, but gives me a pop-up DOS window which, when closed, kills my two loaded programs. Same is true for this: start /B cmd /C "1.lnk" start /B cmd /C "2.lnk" start /B cmd /C "3.lnk" start /B cmd /C "4.lnk" ...

How can I apply authenticated proxy exceptions to an opener using urllib2?

When using urllib2 (and maybe urllib) on windows python seems to magically pick up the authenticated proxy setting applied to InternetExplorer. However, it doesn't seem to check and process the Advance setting "Exceptions" list. Is there a way I can get it to process the exceptions list? Or, ignore the IE proxy setting and apply my ow...

How do I detect when a removable disk is inserted using C#?

The title pretty much says it all. I'm just concerned about Windows, so there's no need to go into esoterica about Mono compatibility or anything like that. I should also add that the app that I'm writing is WPF, and I'd prefer to avoid taking a dependency on System.Windows.Forms if at all possible. ...

Best way to connect to MySQL locally?

MySQL offers many ways (on Windows) to connect to it, those are: Shared memory Named pipes TCP/IP My question is, if MySQL will be run on the same machine of the web server, then which method is best for security and performance? P.S. This is a one web server scenario, no web farm. Thanks ...

Alternative to GetProcessID for Windows 2000

I've accidentally removed Win2K compatibility from an application by using GetProcessID. I use it like this, to get the main HWND for the launched application. ShellExecuteEx(&info); // Launch application HANDLE han = info.hProcess; // Get process cbinfo.han = han; //Call EnumWindows to enumerate windows.... //with this as the callba...

How to Convert DIB to BMP?

How to Convert DIB to BMP? ...

How to add button to other apps window title bar (XP/Vista)

I have the handler of an open window which wasn't necessarily open by my process. How can I add a button to that window and make the button call a certain application (.exe) when clicked? The button could be next to the system menu or the minimize button. This should work for both XP and Vista (a different approach for each version is OK...

On Windows is there a **light-weight** IDE that can be used both with C and Perl?

When I asked this previously I should have mentioned that it's particularly a light-weight IDE that I'm after, so I’m having to ask again as a different question. Something that is not just a text editor, is light-weight and versatile, that would suit Strawberry Perl, the GCC that comes with MinGW, GDB and Subversion. Something that whe...