windows

batch find file extension

If I am iterating over each file using : @echo off FOR %%f IN (*.*) DO ( echo %%f ) how could I print the extension of each file? I tried assigning %%f to a temporary variable , and then using the code : echo "%t:~-3%" but with no success . ...

Visual Studio debugger slows down in in-line code

Since I upgraded to Visual Studio 2008 from vs2005, I have found a very annoying behaviour when debugging large projects. If I attempt to step into inline code, the debugger appears to lock up for tens of seconds. Each time that I step inside such a function, there is a similar pause. Has anyone experienced this and is anyone aware of...

How do I test if a file is a directory in a Batch script?

Is there any way to say if a file is a directory? I have the filename in a variable. In Perl I can do this: if(-d $var) { print "it's a directory\n" } ...

Why would the Win32 OleGetClipboard() function return CLIPBRD_E_CANT_OPEN?

Under what circumstances will the Win32 API function OleGetClipboard() fail and return CLIPBRD_E_CANT_OPEN? More background: I am assisting with a Firefox bug fix. Details here: bug 444800 - cannot retrieve image data from clipboard in lossless format In the automated test that I helped write, we see that OleGetClipboard() sometimes...

What's the foolproof way to tell which version(s) of .NET are installed on a production Windows Server?

This question is not so much programming related as it is deployment related. I find myself conversing a lot with the group in my company whose job it is to maintain our production Windows servers and deploy our code on them. For legal and compliance reasons, I do not have direct visibility or any control over the servers so the only wa...

Sending an arbitrary Signal in Windows?

Linux supports sending an arbitrary Posix-Signal such as SIGINT or SIGTERM to a process using the kill-Command. While SIGINT and SIGTERM are just boring old ways to end a process in a friendly or not-so-friendly kind of way, SIGQUIT is meant to trigger a core dump. This can be used to trigger a running Java VM to print out a thread dump...

Deleting Windows performance counter categories

I have a custom performance counter category. Visual Studio Server Explorer refuses to delete it, claiming it is 'not registered or a system category'. Short of doing it programmatically, how can I delete the category? Is there a registry key I can delete? ...

Catching 'external drive inserted' event in a windows service

I'm trying to write a super-simple podcast-to-device downloading service to use for running. I imagine that it'll like this: Whenever a particular device is plugged in (via USB), it: Deletes everything from the device Checks for all the latest entries in a number of RSS Podcast feeds Downloads those to the device Notifies the user a...

Tutorial for Windows Shell Extensions

I've been postponing this part of the project because I haven't found any particular helpful example/tutorial for these 2 aspects of Shell Extensions: Return information for the Hint when you hover over a file. Context pop-up menu with extension context, if it makes sense. Cheers. ...

Win32/MFC Get window rect from client rect

I know there is a function somewhere that will accept a client rect and it will convert it into a window rect for you. I just can't find / remember it! Does anyone know what it is? It will do something similar to: const CRect client(0, 0, 200, 200); const CRect window = ClientRectToWindowRect(client); SetWindowPos(...) ...

Tips, Guides and/or Tutorials on writing a Windows desktop app for a PHP programmer by trade

Yup, long title. I've been programming in PHP for the last 6 years or so for work and personal projects, but I've got an idea for a desktop app (which incidentally, uses a web REST api). I'm debating on how to approach this - I've got some experience in Java, C++, Perl and Python, but have never had the chance or opportunity to write a...

How do I test if another installation is already in progress?

Assuming I'm trying to automate the installation of something on windows and I want to try to test whether another installation is in progress before attempting install. I don't have control over the installer and have to do this in the automation framework. Is there a better way to do this, some win32 api?, than just testing if msiexec ...

How to check if directory exists in %PATH%?

How does one check if a directory is already present in the PATH environment variable? Here's a start. All I've managed to do with the code below, though, is echo the first directory in %PATH%. Since this is a FOR loop you'd think it would enumerate all the directories in %PATH%, but it only gets the first one. Is there a better way of...

Visual Studio 2008 source control for small teams

I work on a small web team where I am the only .NET developer currently using Visual Studio 2008 Professional to build and maintain a few web applications. I am about to start training another member of our team so we purchased him a copy of Visual Studio 2008 Professional. I've looked into Visual Source Safe, but I'm dubious. I don't ...

GDI has been accelerated. Does anyone know when this happened?

To sketch the background of this question : at work we use Dell Precision workstations. My current one has got an NVidia Quadro FX1700. My team is developing the graphics components for a real time data acquisition system. So we are always looking out to see if the graphics operations don't use up too much CPU time. For quick checks, we ...

What is the best tool for creating user guides with screenshots on Windows?

I need to write some guides for my development team on how to get some software up and running and would like to include partial screenshots. Are there any tools that are particularly good at this? Word is almost there in that I can easily paste screenshots inline with text, but I need the ability to crop the images and Word image manipu...

Rules for multi-user WinForms apps on Vista

We have an MSI installer for a .Net WinForms app for Windows XP that installs and runs only as an admin. Users have to log in to the app when it runs. Customers want it to install and run under a user account under Vista, and to use their Windows account. A preliminary look through the code shows lots of problems; the installer writes t...

Can network interfaces be bridged "automatically" with Windows?

I'm working on a portable device, that when I connect it to a windows machine (over USB), it shows up as a seperate network interface to the PC. This is great, except when I want to connect several devices together, and want them to all be on the same network (subnet). I'm looking for the ability to bridge network interfaces together au...

Setting up our new Dev server What is the easiest way to assign multiple IP addresses

I'm setting up our new Dev server, what is the easiest way to assign multiple IP addresses to Windows 2008 Server Network Adapter? I'm setting up our development machine, running IIS 7 and want to have the range between 192.168.1.200 - .254 available when I'm setting up a new website in IIS 7. ...

WM_GETMINMAXINFO, the ptMaxSize not having any effect

In handling a WM_GETMINMAXINFO message, I attempt to alter the parameter MINMAXINFO structure by changing the ptMaxSize. It doesn't seem to have any effect. When I receive the WM_SIZE message, I always get the same value, no matter whether I increase or decrease the ptMaxSize in the WM_GETMINMAXINFO. ...