Huddled Masses
The internet home of Joel "Jaykul" Bennett...
Browse: Home / PInvoke

PInvoke

PoshConsole with the MetroWindow behavior

WPF Window “Native” Behavior: Metro Window

By Joel 'Jaykul' Bennett on 04-Nov-2010

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 [...]

Posted in Huddled | Tagged Custom Chrome, Metro, PInvoke, Windows 7, WPF

Using alternate credentials with the FileSystem in PowerShell

By Joel 'Jaykul' Bennett on 20-May-2010

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 [...]

Posted in Huddled | Tagged Add-Type, Credentials, FileShare, PInvoke, Server, UNC, Windows PowerShell

Fun with PInvoke and Aero Peek

By Joel 'Jaykul' Bennett on 23-Aug-2009

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 [...]

Posted in Huddled | Tagged Aero Peek, API, DwmSetWindowAttribute, DWMWA_EXCLUDED_FROM_PEEK, PInvoke, PowerShell, Scripting, Win32, Windows 7 | 5 Responses

The behavior collection doesn't get created...

WPF Window “Native” Behavior: The Base Class

By Joel 'Jaykul' Bennett on 16-Oct-2008

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 [...]

Posted in Huddled | Tagged Development, Interop, NativeBehaviors, PInvoke, Windows Presentation Foundation, WndProc, WPF

How to get the Char(acter) and VirtualKey from a WPF KeyDown event

By Joel 'Jaykul' Bennett on 22-Sep-2008

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 [...]

Posted in Huddled | Tagged .Net Framework, Char, EventHandler, Interop, KeyDown, PInvoke, ScanCode, VirtualKey, WPF

Setting Windows internet connection proxy from C#

By Joel 'Jaykul' Bennett on 26-Jul-2008

I have a problem with my laptop where I connect to my home network and my work network, and my school network … and I have to use different proxy settings for Windows internet connection settings (which are used by virtually all .Net apps, including PowerShell) by default… Of course, there are a lot of [...]

Posted in Huddled | Tagged Development, InternetSetOptions, PInvoke, PowerShell, Proxies, Win32 | 2 Responses

Lijit Search

Tags

.Net .Net 2008 Scripting Games Automation Bugs Design Development Funny Gadgets GeoShell GUI Huddled Masses Internet licensing Microsoft Modules My Software News Personal PInvoke Pipeline Politics PoshCode PoshConsole PowerBoots PowerShell PowerShell Functions PowerTips Rants Recommender Repository Scripting ShowUI Software Solutions Textile Tips User Group UserInterface WalkThrough WebHosting Windows 7 WordPress WPF Xml

About Huddled Masses

This is web site is dedicated to the musings of Joel Bennett (aka Jaykul) about technology, software, software development, the web, and the world.

Any resemblance of the views expressed and the views of my employer, my terminal, or the view out my window are purely coincidental. The resemblance between them and my own views is non-deterministic. The question of the existence of views in the absence of anyone to hold them is left as an exercise for the reader.

P.S.: I occasionally link to things I think are great. When I do, I occasionally find a "referral code" so I can make a little cash. I promise that I don't link to anything just because of that cash (I wouldn't cross the street for the amount of cash those links bring in, never mind write a whole blog post) ... but I do not promise that things I link to will stay great as time passes, nor that you will agree with me about their greatness!

Archives

  • April 2012
  • February 2012
  • January 2012
  • October 2011
  • August 2011
  • July 2011
  • June 2011
  • March 2011
  • February 2011
  • January 2011

Copyright © 2012 Joel Bennett.

Powered by WordPress and Hybrid.