ESMITHY.NET
Tagged with

Windows

UI Horror: Windows 8 BSOD

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 …

Amazon Glacier and CloudBerry Online Backup

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 …

Batch File Libraries

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 …

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 …

Transparent WinForms Label

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 …

Rounded Rectangluar Regions

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 …

Why StringComparison.Ordinal Is Usually the Right Choice

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 …

Unicode Surprises

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 …

Sleep Mode from .NET

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 …

Getting an IStream on a File

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 …