Re: Calling ALT-TAB
From: Ignacio Machin \( .NET/ C# MVP \) ("Ignacio)
Date: 03/03/05
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: IIS Configuration - ASP.net doesn't work"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: Problem with Toolbar and ImageList"
- In reply to: Chris Mason: "Calling ALT-TAB"
- Next in thread: Ignacio Machin \( .NET/ C# MVP \): "Re: Calling ALT-TAB"
- Reply: Ignacio Machin \( .NET/ C# MVP \): "Re: Calling ALT-TAB"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 3 Mar 2005 09:44:33 -0500
Hi,
You will have to PInvoke, first you need to get the handle of the target
window, then you need to give it focus.
Here is some code:
[DllImport("coredll",EntryPoint="FindWindow")]
public static extern IntPtr FindWindow(string lpClassName,string
lpWindowName);
[DllImport("coredll",EntryPoint="SetForegroundWindow")]
public static extern bool SetForegroundWindow(IntPtr hWnd);
//this is how you use it
IntPtr mainwin = FindWindow(null, "Product Details");
if(! mainwin.Equals(new System.IntPtr(0)))
{
//Ask for login/Password
SetForegroundWindow(mainwin);
}
cheers,
-- Ignacio Machin, ignacio.machin AT dot.state.fl.us Florida Department Of Transportation "Chris Mason" <tealdeer@gmail.com> wrote in message news:u2ZHmS$HFHA.2620@tk2msftngp13.phx.gbl... >I have an application that runs full screen on a system and I would like to > be able to (at times) switch another program using an ALT-TAB like > interface. However the system only has a touchscreen display so doing > this > from a keyboard is not an option. Is there any way I can instantiate the > built in ALT-TAB window or is there any way I can generate the ALT-TAB > event/message progammatically. > > Thanks for any help. > Chris > >
- Next message: Ignacio Machin \( .NET/ C# MVP \): "Re: IIS Configuration - ASP.net doesn't work"
- Previous message: Ignacio Machin \( .NET/ C# MVP \): "Re: Problem with Toolbar and ImageList"
- In reply to: Chris Mason: "Calling ALT-TAB"
- Next in thread: Ignacio Machin \( .NET/ C# MVP \): "Re: Calling ALT-TAB"
- Reply: Ignacio Machin \( .NET/ C# MVP \): "Re: Calling ALT-TAB"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|