WPF Window “Native” Behavior: Metro Window
A couple of years ago I first introduced my native behaviors for WPF to support enhancing WPF applications with behaviors that require PInvoke or hooking the Window’s message processing loop: WndProc. You can read all about it on my previous posts, including the original implementations of my Snap To Screen Edges behavior, and my Custom [...]
Using alternate credentials with the FileSystem in PowerShell
In PowerShell, cmdlets like Get-ChildItem and Get-Content support a -Credential parameter so you can access resources that require you to log in… the problem is that the built-in FileSystem provider does not. So as an example, if you have a server on a different domain and you want to copy files off of it, you [...]
Fun with PInvoke and Aero Peek
There are so many fun things you can do in Windows when your scripting language allows you to make PInvoke calls to Win32 APIs … but I have to say it’s amazing how many things have been added to Windows recently and still left out of the .Net framework … Anyway, on to the Aero [...]
WPF Window “Native” Behavior: The Base Class
I wrote yesterday about the WPF Snap-To Behavor that I created, and showed you how simple it is, but I skipped over where the magic happens, so I thought I’d go through how I created the Native Behaviors collection class, because there are a few cool tricks in here that I wanted to share with [...]
How to get the Char(acter) and VirtualKey from a WPF KeyDown event
While working on my WPF PowerShell console, I’m working on implementing PSRawUserInterface, and had to implement a method called ReadKey which returns a KeyInfo object. KeyInfo is a pretty simple struct class with four properties: VirtualKeyCode Character ControlKeyState KeyDown So it doesn’t seem like it would be a real problem … just handle the KeyDown [...]