Jump to content

Need help to Swiitch Programs windows with IE


Recommended Posts

Hello to all,

I need to have in one screen a progrma running and a internet page open and swicthing between both I am using tho option winactivated.

But for the internet page a cannot put the page in front:

This is what I did:

While 1

WinActivate("[CLASS:iexplore]", ""); Activate Internet Explorer

Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go full screen

Sleep(10000); Internet Explorer for 30 seconds

Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go windowed

WinActivate("[CLASS:WMPlayerApp]", ""); Activate Windows Media Player

Send("{ALTDOWN}{enter}{ALTUP}"); Make Media Player go full screen

Sleep(5000);Show Media Player in full screen for 10 seconds

Send("{ALTDOWN}{enter}{ALTUP}"); Make Media Player go windowed

WEnd

Can anyone help me?

Thanks in advance

Link to comment
Share on other sites

Most of the AutoIt functions return a value or set @error. WinActivate returns 0 when there was a problem. So I would use

While 1
    $iRC = WinActivate("[CLASS:iexplore]", ""); Activate Internet Explorer
    If $iRC = 0 Then MsgBox(16, "", "WinActivate for IE was not successful")
    Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go full screen
    Sleep(10000); Internet Explorer for 30 seconds
    Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go windowed

    $iRC = WinActivate("[CLASS:WMPlayerApp]", ""); Activate Windows Media Player
    If $iRC = 0 Then MsgBox(16, "", "WinActivate for WMP was not successful")
    Send("{ALTDOWN}{enter}{ALTUP}"); Make Media Player go full screen
    Sleep(5000);Show Media Player in full screen for 10 seconds
    Send("{ALTDOWN}{enter}{ALTUP}"); Make Media Player go windowed
WEnd
Edited by water

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

I use IE9 and it works when I change your statement to

$iRC = WinActivate("[Class:IEFrame]")

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Works perfectly!!!!! Thanks..

One more question that you can help me... It´s my first time doing this....sorry

On this script I need to put a Powerpoint presentatio running instead of windows media player.....How can I do this? Switch between IExplore and power point presentation?

Thanks once more

Link to comment
Share on other sites

You are talking about a fullscreen presentation or just a presentation opened in powerpoint?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

The class for a powerpoint presentation seems to be "screenClass" with Office 2010.

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

no can do......

While 1

$iRC = WinActivate("[CLASS:IEFrame]", ""); Activate Internet Explorer

If $iRC = 0 Then MsgBox(16, "", "WinActivate for IE was not successful")

Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go full screen

Sleep(10000); Internet Explorer for 10 seconds

Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go windowed

$iRC = WinWaitActive("[CLASS:screenClass]", "" ); Activate Windows Power Point

If $iRC = 0 Then MsgBox(16, "", "WinActivate for PPT was not successful")

Send("{ALTDOWN}{enter}{ALTUP}")

Sleep(5000)

Send("{ALTDOWN}{enter}{ALTUP}")

WEnd

It only open the Iexplorer....

Link to comment
Share on other sites

Just tested with Office 2010 and it works.

Start the Autoit Window Info Tool, start the powerpoint presentation and move the crosshair over the powerpoint presentation. What do you get as Window class?

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

This is what I get:

Class: screenClass

Position: 0, 0

Size: 1280, 1024

Style: 0x94000000

ExStyle: 0x00000000

Handle: 0x000C0820

>>>> Control <<<<

Class: paneClassDC

Instance: 1

ClassnameNN: paneClassDC1

Name:

Link to comment
Share on other sites

This works fine for me:

While 1
    $iRC = WinActivate("[CLASS:IEFrame]", ""); Activate Internet Explorer
    If $iRC = 0 Then MsgBox(16, "", "WinActivate for IE was not successful")
    Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go full screen
    Sleep(5000); Internet Explorer for 10 seconds
    Send("{ALTDOWN}{enter}{ALTUP}"); Make Internet Explorer go windowed
    $iRC = WinActivate("[CLASS:screenClass]", ""); Activate Windows Power Point
    If $iRC = 0 Then MsgBox(16, "", "WinActivate for PPT was not successful")
    Sleep(2000)
WEnd

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Glad to be of service ;)

My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download
Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

Tutorials:
ADO - Wiki
WebDriver - Wiki

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...