Desktop Functions: Smart Device Functions:
|
SetForegroundWindow (user32)
C# Signature:
// For Windows Mobile, replace user32.dll with coredll.dll VB Signature:
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As IntPtr) As Long User-Defined Types:None. Notes:None. Tips & Tricks:This is especially useful for test automation to make sure the Application Under Test (AUT) retains focus before manipulating it. This may be called several times in an automated test script, so it is best to create a method similar to the example below. Sample Code (C#):
public static void Main(string[] args) Sample Code (C#):
public static bool BringWindowToTop(string windowName, bool wait) Alternative Managed API:The ManagedWindowsApi project (http://mwinapi.sourceforge.net) provides a static property ManagedWinapi.SystemWindow.ForegroundWindow which can be set. Please edit this page!Do you have...
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more). |
|