cancel
Showing results for 
Search instead for 
Did you mean: 

How show window ?

BordessoullesVi
Level 3
Hi, I have an Internet Explorer window and another application that I launched via blue prism. How to switch between windows and do treatments on it??? Is there a basic function in blue Prism ?   I tried several codes: In Initializes: Public Class PInvoke                 Public Shared Function ShowWindow (ByVal hwnd As IntPtr, ByVal nCmdShow As Integer) As Boolean                 End Function                 Public Shared Function SetForegroundWindow(ByVal hwnd2 As IntPtr) As Boolean                 End Function End Class Public Declare Function BringWindowToTop Lib "user32" (ByVal hwnd As IntPtr) As Boolean   Object code: PInvoke.ShowWindow(hWnd, nCmdShow) with hWnd the process ID and nCmdShow (https://msdn.microsoft.com/fr-fr/library/windows/desktop/ms633548(v=vs.85).aspx)   But the ShowWindow or BringWindowToTop  or SetForegroundWindow function does not seem to do anything, PB goes through the box but nothing happens.   Helppp!    
3 REPLIES 3

BordessoullesVi
Level 3
Ok I found a solution The problem comes from the hWind function of the ShowWindow function (hWnd, nCmdShow). You should not use the Process Id of the window but use the ""handle of the window"" (use the FindWindow function).   But is there a basic function in blue Prism that does this (change active window) ?

PSSupport
Staff
Staff
You need at least one object per application, and if you spy the main window as a Win32 element, there is an Activate action available.

BordessoullesVi
Level 3
spy the main window as a Win32 element why I didn't think about it :S  but I have a generic function now, no need to add in each objects actions activates '^^ thx