windows

Testing network interrupts in software

I have a network C++ program in Windows that I'd like to test for network disconnects at various times. What are my options? Currently I am: Actually disconnecting the network wire from the back of my computer using ipconfig /release Using the cports program to close out the socket completely None of these methods though are ideal ...

How do I get my Java application to shutdown nicely in windows?

I have a Java application which I want to shutdown 'nicely' when the user selects Start->Shutdown. I've tried using JVM shutdown listeners via Runtime.addShutdownHook(...) but this doesn't work as I can't use any UI elements from it. I've also tried using the exit handler on my main application UI window but it has no way to pause or ha...

How to determine the size of the button portion of a Windows radio button

I'm drawing old school (unthemed - themed radios are a whole other problem) radio buttons myself using DrawFrameControl: DrawFrameControl(dc, &rectRadio, DFC_BUTTON, isChecked() ? DFCS_BUTTONRADIO | DFCS_CHECKED : DFCS_BUTTONRADIO); I've never been able to figure out a sure fire way to figure out what to pass for the RECT. I've been u...

How can I find the current DNS server?

I'm using Delphi and need to get the current Windows DNS server IP address so I can do a lookup. What function should I call to find it? The only solution I have right now does an ipconfig/all to get it, which is horrible. ...

read/write to Windows Registry using Java

Is it possible to read/write to windows registry using java? ...

Knowing which java.exe process to kill on a windows machine

When a java based application starts to misbehave on a windows machine, you want to be able to kill the process in the task manager if you can't quit the application normally. Most of the time, there's more than one java based application running on my machine. Is there a better way than just randomly killing java.exe processes in hope t...

Remote installing of windows service

I need to remotely install windows service on number of computers, so I use CreateService() and other service functions from winapi. I know admin password and user name for machines that I need access to. In order to gain access to remote machine I impersonate calling process with help of LogonUser like this: //all variables are ini...

GDI+ DrawImage() with transparent bitmap to a printer

Does anybody have any pointers on how to successfully draw a bitmap that has an alpha channel using Graphics::DrawImage() when the Graphics context is created based on a printer HDC? The printer drivers don't generally support alpha blending - so is there an alternative to rendering everything to an offscreen bitmap and just sending that...

polyline with gradient

Is there a way to draw a line along a curved path with a gradient that varies in a direction perpendicular to the direction of the line? I am using the GDI+ framework for my graphics. ...

How check if given string is legal (allowed) file name under Windows?

I want to include batch file rename functionality in my application. User can type destination filename pattern and (after replacing some wildcards in pattern) I need to check if it's going to be legal filename under Windows. I tried to use regular expression like [a-zA-Z0-9_]+ but it doesn't include many national-specific characters fro...

How to write a C++ FireFox 3 plugin (not extension) on Windows?

Could someone write-up a step by step guide to developing a C++ based plugin for FireFox on Windows? The links and examples on http://www.mozilla.org/projects/plugins/ are all old and inaccurate - the "NEW" link was added to the page in 2004. The example could be anything, but I was thinking a plugin that lets JavaScript set the name...

When did I last talk to my Domain Server?

How can my app get a valid "last time connected to domain" timestamp from Windows, even when the app is running offline? Background: I am writing an application that is run on multiple client machines throughout my company. All of these client machines are on one of the AD domains implemented by my company. This application needs to t...

Capturing the desktop with Windows Media Format(WMF)

I am using Windows Media Format SDK to capture the desktop in real time and save it in a WMV file (actually this is an oversimplification of my project, but this is the relevant part). For encoding, I am using the Windows Media Video 9 Screen codec because it is very efficient for screen captures and because it is available to practicall...

Including files case-sensitively on Windows from PHP

We have an issue using the PEAR libraries on Windows from PHP. Pear contains many classes, we are making use of a fair few, one of which is the Mail class found in Mail.php. We use PEAR on the path, rather than providing the full explicit path to individual PEAR files: require_once('Mail.php'); Rather than: require_once('/path/to/pe...

How to get name associated with open HANDLE

What's the easiest way to get the filename associated with an open HANDLE in Win32? ...

Detecting if WinHelp is Installed on Vista or newer Windows

Is there a reliable way to detect whether or not WinHelp is installed on Windows Vista or newer versions of Windows? If possible, I'd like a solution that's not specific to any particular version of Windows. I've posted this question to other message boards and got back answers regarding the size of Winhlp32.exe before and after install...

Can you recommend a good C# windows programming book (for Java developer)

Hi I'm looking for a good C# programming book that discusses Windows programming - UI, forms, office plugins etc - for developers (lots of Java experience). Thanks for any help! ...

Why does Tomcat 5.5 (with Java 1.4, running on Windows XP 32-bit) suddenly hang?

I've been running Tomcat 5.5 with Java 1.4 for a while now with a huge webapp. Most of the time it runs fine, but sometimes it will just hang, with no exception generated, and no apparant way of getting it to run again other than re-starting Tomcat. The tomcat instance is allowed a gigabyte of memory on the heap, but rarely exceeds 300...

Image Misalignment in Visual Studio application

I have a Visual Studio application with a splash screen image cut into "slices". The positions are specified in the Form Designer so they line up properly on the screen. However, the images are out of place when the application is run on the Chinese version of Windows XP. It looks as if the image slices were "exploded" apart. What's goi...

How can I get Column number of the cursor in a TextBox in C#?

I've got a multiline textBox that I would like to have a label on the form displaying the current line and column position of, as Visual Studio does. I know I can get the line # with GetLineFromCharIndex, but how can I get the column # on that line? (I really want the Cursor Position on that line, not 'column', per se) ...