Posts Tagged: c#

C# UNC Path

0
UNC Path

For some odd reason, System.IO doesn’t include a method to get the UNC path for a file or directory. Even stranger, many code samples resort to using p/invoke in order to get that information. But then I came across this StackOverflow answer that explained a pure .NET way to do the same thing. I gave …

Coded UI: Failed To Perform Action On Blocked Control Exception

0
CSharpTesting

Today I encountered a very aggravating exception while playing back some coded ui tests. I had a grid control, with multiple rows. On one row, I could perform a mouse click. But on another row, I consistenly got a FailedToPerformActionOnBlockedControlException. Yet nothing was blocking the row.

Show Only The Year & Month With A DevExpress DateEdit

3
Show Only The Year And Month

One of the great disappointments of a programmer’s workday is creating a component only to discover shortly after finishing that someone else had already created the exact same component. Happened to me the other day. Literally 30 minutes after quietly putting together a DevExpress DateEdit that only displayed years and months, I hear a coworker …

Keyboard Hooking With C# – Redux

2
KeyboardHook Redux

Many moons ago, in preparation for a major rewrite to my QuickShift application, I wrote a low level keyboard hook implementation in C#. The original version of QuickShift employed global hotkeys to respond to keyboard input, however that mechanism proved to offer less-than-ideal performance: When the OS recognizes a hotkey combination, it responds by posting …

Extracting Icons From Exe & Dll Files

2
Icon Extractor Screen Shot

There has been a time or two when I’ve wanted to use an icon from shell32.dll or imageres.dll for my own purposes. But for some reason I was under the impression it was a huge pain in the ass to extract them. Not the case, as it turns out.

(Balloon) ToolTip Misbehavior

0
I do what I want!

If you assign a balloon-style ToolTip to a control on a form, the balloon’s stem will correctly point to the assigned control during a mouseover event. If there’s room, the balloon will display above and slightly to the right of the assigned control… …if there isn’t room (because the control is too near a screen …

Keyboard Hooking With C#

16
Keyboard Hook

This post has been updated. Check out the new version. When I first started coding QuickShift, I stumbled upon a blog post which described a Hotkey class the author had written based on the RegisterHotkey and UnregisterHotkey Windows API functions. I found it because someone had posted a link on this StackOverflow question which, as of …