Anti-nuisance lawsuit warning: The purpose of these notes is to remind me, Zoegond, of stuff or to help me work stuff out. They may contain mistakes.

Quick

  • ($a, $b....) = unpack("A2A7...", $packed)
  • push( array, list )

Monday, April 19, 2010

C# window interaction

The easiest way to do the window activation/control stuff that AutoIt and VB can is to add a reference to the Microsoft.VisualBasic assembly to your project.

You can then have code like

Microsoft.VisualBasic.Interaction.AppActivate("Calculator");

- SendKeys is already available in System.Windows.Forms, but there's no simple way in there to activate a window so as to send keys to it.

- SendKeys.Send won't work from a form constructor, there'll be a run-time error. Put it in the form Load event handler or anywhere 'later' - looks like the form has to be running and handling messages before it can send keys.

Followers

Blog Archive