0

I'm looking for an api that can cause a windows select/highlight event to occur on a windows desktop, without actually causing the mouse cursor to move.. I can cause the mouse cursor to move with :

public static extern bool SetCursorPos(int X, int Y);

But that moves the actual cursor to that point... I'm looking for a way to highlight only as one might do by using the tab and arrow keys to move around the windows desktop. Any suggestions are appreciated..

regards, rob

Robert Fleming
  • 145
  • 4
  • 15

1 Answers1

0

I think you may be looking for SetFocus. You can get a control's handle with Control.Handle or FindWindow , and p/invoke SetFocus (use IntPtr as the argument type).

Alan
  • 7,875
  • 1
  • 28
  • 48
  • Thanks. Those sort of work. but my input (from a vendor SDK library) provides an x/y set of co-ordinance. I'd like to turn that into a control highlighting feature, leaving the mouse pointer where it is.. Any further thoughts? thx. – Robert Fleming Sep 25 '13 at 19:15
  • @RobertFleming http://msdn.microsoft.com/en-us/library/windows/desktop/ms633558(v=vs.85).aspx or http://msdn.microsoft.com/en-us/library/windows/desktop/ms632676(v=vs.85).aspx – Alan Sep 25 '13 at 19:23