Articles tagged with Windows

UI Horror: Windows 8 BSOD

By Eric

My PC is sad. I know this because of the frowny face. Unfortunately, I know not much more, because my PC won't boot, and Microsoft decided to provide as little information about the error as possible on their new BSOD screen.

Hmm... scary (but potentially useful) hexidecimal-laden error messages or …

Read more...

Amazon Glacier and CloudBerry Online Backup

By Eric — 3 minute read

checkbox-0 Offsite backup for critical files

This task has been lingering undone on my to-do list for months. I imagined that I'd figure out some way to use Dropbox, Google Drive, Sky Drive, or something to keep my data safe in case something catastrophic happened at the house. All those solutions …

Read more...

Batch File Libraries

By Eric — 2 minute read

I've always considered batch files as kind of ghetto. Anything too complex devolves into a morass of gotos and labels. But I recently put together some install batch scripts that I was actually pleased with, including a clean mechanism for sharing common code.

A while back, I used WiX to …

Read more...

MessageBox: Just Say Nein

By Eric — 1 minute read

The Windows MessageBox is really convenient to use. A single line of code gets you a dialog box with a caption, a message, an icon and a set of available buttons that cover a lot of possible input scenarios. Unfortunately, the text on the buttons is supplied by the system …

Read more...

Transparent WinForms Label

By Eric — 2 minute read

Easy control transparency isn't exactly a hallmark of Windows Forms. If you have a form with a background image or a gradient, the stock controls paint with a solid background to give a criminally egregious aesthetic.

If you search the web for a solution, you might come up with a …

Read more...

Rounded Rectangluar Regions

By Eric — 4 minute read

There are lots of examples that demonstrate how to draw a rectangle with rounded corners using GDI+ in .NET. Converting such a rectangle to a Region so that it can be filled or be used for the geometry of a window can have less than perfect results, though.

For example …

Read more...

Why StringComparison.Ordinal Is Usually the Right Choice

By Eric — 2 minute read

A question that arose in response to my previous post (about how string comparisons can produce unexpected results when done in a culture-sensitive way) was Which is right, StringComparison.Ordinal or StringComparison.InvariantCulture? The short answer: StringComparison.Ordinal.

There is a good article explaining the differences between the StringComparison enum …

Read more...

Unicode Surprises

By Eric — 2 minute read

I got a defect from QA today saying that our product was unable to track files in paths containing Unicode characters. I'll admit that I was skeptical. I had just tried that myself the other day and it worked perfectly. Trying it again today also worked perfectly, but the QA …

Read more...

Sleep Mode from .NET

By Eric

I have a little backup program that I wrote that includes the ability to shut down the machine when a backup is complete. I wanted to add the option of putting the machine to sleep instead of shutting down, but it took me a while to figure out how to …

Read more...

Getting an IStream on a File

By Eric

Getting a COM IStream instance on a normal file seems like something that should be trivial to do, but it always seems to take some hunting to remember how it is actually done.

There is a function in the shell API that will return an IStream on a file: SHCreateStreamOnFile …

Read more...