title: What's the equivalent of PostMessage to self, for Windows Forms?
body: <p>I'm writing a custom control derived from <code>System.Windows.Forms.Control</code>.</p>
  
  <p>The control is using the <code>Control.KeyDown</code> event, to watch keystrokes: I should handle some keystrokes (for example <code>&lt;Ctrl&gt;-K</code>) as hotkeys, which cause me to launch a dialog box.</p>
  
  <p>If I launch the dialog from my <code>onKeyDown</code> event handler, the dialog is displayed before I set <code>KeyEventArgs.SuppressKeyPress</code> to <code>true</code> and return (and so I'm failing to suppress the <code>K</code> keypress). Instead, I'd like to return from the <code>onKeyDown</code> event handler, and launch the dialog afterwards. To do this, after I return from the <code>onKeyDown</code> event handler I need to be invoked again somehow, with some kind of 'launch the dialog' event.</p>
  
  <p>On Win32, I could generate this event by using the <code>PostMessage</code> API, to send a registered window message to myself: I would receive this message right after any previous message in my message queue, and use it as the signal to launch my dialog. Here however I can't use <code>PostMessage</code> function (nor the <code>WndProc</code> method) because I want to use strictly <strong>managed</strong> APIs (without needing <code>SecurityPermissionFlag::UnmanagedCode</code>).</p>
  
  <p>So what would be the managed equivalent, for a thread (my UI thread) to schedule an asynchronous callback: perhaps a timer of some kind? Some kind of self-<code>Invoke</code>?</p>