How show window ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-07-18 07:24 PM
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
26-07-18 08:41 PM
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) ?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-07-18 12:40 AM
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.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
27-07-18 12:51 PM
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
