windows

Windows PC as a USB slave to emulate a thumbdrive

I need to create a application that will allow a Windows PC (XP/Vista) to emulate a thumbdrive. That is, when the PC is plugged into either another Windows system, or in this case, a piece of hardware that allows for USB thumbdrives to be plugged in, a folder on the computer looks like a giant thumbdrive. Any thoughts on where a guy wo...

Check from .NET if Windows Update is enabled

Is there any way to check from .NET if windows update is enabled? I want to prompt the users every time they log into my app that their computer might be at risk and give them a link to windows update website (or windows update application from control panel). Preferably it should work on XP, Vista and Windows 7. Maybe there is a regis...

Getting Local Windows User login session timestamp in C#

Hi, I've been trying to look around the various .NET class library's for some where I can get the logged in user of the local machine, either connected to a domain or not. So far System.Security.Principal.WindowsPrincipal LoggedUser = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal; // This retu...

How can I detect if the file for an open filehandle has been deleted on Windows using Perl?

Hello, I have a process with an open filehandle to a file. I need to detect if this file has been deleted by another process (there may be a file with the same name in its place). On UNIX I was comparing the inodes of my filehandle and the file-path via stat, but this doesn't work on Win32. How can I do this in Perl? Thanks, -Peter ...

Restrict functionality to a certain computer.

Hi, I have a program that is using a configuration file. I would like to tie the configuration file to the PC, so copying the file on another PC with the same configuration won't work. I know that Windows Activation Mecanism is monitoring hardware to detect changes and that it can tolerates some minor changes to the hardware. Is the...

How do you handle right click on a treeview in WTL/Win32 apps?

I have a basic app written with ATL, using the wizard with VS2008. I have a treeview in the left side of the app. I see how to (painfully) add tree items. Question is how do I show a menu when the mouse is right clicked? How do I trap any click events on each item that could be selected? ...

Launch Application in a minimized state from Java

This is a followup question to one I previously asked: start-program-if-not-already-running-in-java I didn't get a great solution there (as there doesn't appear to be one), but I have a related question: Is there anyway to launch an application in Java code (an .exe in Windows, not a Java app) and have it start minimized? Or perhaps ...

Why can I only open 2045 files with Tie::File on Windows?

I have the following code that tries to tie arrays to files. Except, when I run this code, it only creates 2045 files. What is the issue here? #!/usr/bin/perl use Tie::File; for (my $i = 0; $i < 10000; $i++) { @files{$i} = (); tie @{$files{$i}}, 'Tie::File', "files//tiefile$i"; } Edit: I am on windows ...

XML RPC GUI for developers in Windows?

Is there something like this for Windows? If not, what is the easiest/quickest way to test an XML RPC? ...

How to disable driver signing on 64 bit Vista SP1

I am testing a driver for which we haven't got WHQL certification yet. So I need to disable driver signing before I install the driver. Does any one know how to disable this on Vista XP1 64-bit version through command line or some other program? I don't want to do an F8 everytime the system boots to disable driver signing. I tried the ...

Windows Services and shutting down EC2 nodes

I've got a fairly simple Windows service running on testbed EC2 nodes right now that basically: Calls a Web Service on a machine in our local data center when the service starts (the service is set to Automatic startup, so it runs when the instance comes online). Calls another Web Service once a minute as a monitoring heartbeat. Calls ...

Batch rename issue when dealing with special chracters in the filename

I have several hundred *.mp3 files in c:\files. There are all imaginable filenames in there like milad.mp3 (good behaving) hey you.mp3 (space in filename) systemofadown.mp3 (long filename) howdy(1).mp3 (parentheses in filename) and any combination of the last three conditions. I want to rename the files to 001-test.mp3, 002-mp3, ... ...

CryptExportKey in C#

What is the C# equivalent to this CryptExportKey call? CryptExportKey(hKey, hPublicKey, SIMPLEBLOB, 0, lpData, &nSize); and it would be nice if you can give a description on your C# code where hKey, hPublicKey and SIMPLEBLOB (or their equivalent in C#) are being used ...

Normalize file path with WinAPI

Given two file path strings with potentially different casing and slashes ('\' vs '/'), is there a quick way (that does not involve writing my own function) to normalize both paths to the same form, or at least to test them for equivalence? I'm restricted to WinAPI and standard C++. All files are local. ...

Can I you reassign keyboard keys in Visual Studio 2008 or at least in Microsoft Windows?

As I'm sure most of y'all are, I'm tired of having to press the SHIFT key every time I write a function call in C#, or for that matter any language. So, is their any way to cause the "[" key on my keyboard to type a "(" on the screen, and also cause the "]" key to cause a ")" to be typed on the screen? ...

How to get around a 'by design' issue with Windows dir?

dir /b produces a nice file-only list dir /x produces a detailed listing (date, time, size, longname, shortname) if you combine the two (i. e. dir /b /x) the /x switch gets ignored. this behavior as per this page is by design. so if you ask for a simple list containing only of shortnames of files, redmont says it is against the rules ...

Handling file attributes in python 3.0

I am currently developing an application in python 3 and i need to be able to hide certain files from the view of people. i found a few places that used the win32api and win32con but they don't seem to exist in python 3. Does anyone know if this is possible without rolling back or writing my own attribute library in C++ ...

GUI editor for Ruby in Windows

I am developing a Windows application using Ruby. What is the best GUI editor for Ruby? ...

Finding the current active language on windows

What are the possible solutions for finding the current active language which appears on the Windows language bar ? ...

Windows process exec'ed from Java not terminating

I'm creating a process on Windows from Java. My problem is that this process doesn't terminate. Here's a sample program: import java.io.IOException; public class Test { /** * @param args * @throws IOException * @throws InterruptedException */ public static void main(String[] args) throws IOException, InterruptedException { Proc...