Sign in to follow this  
Followers 0
AXPPES

Need help to Swiitch Programs windows with IE

17 posts in this topic

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

Share this post


Link to post
Share on other sites



It doesn´t work...:-(

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Ok...I got this message error:

WinActivated for IE was not successfull

I open WMplayer ok..but I cannot open IE page

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

A full screen presentation and a full screen webpage with statistics....

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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....

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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:

Share this post


Link to post
Share on other sites

But my office is 2007

Share this post


Link to post
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 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
Share on other sites

Thanks a lot for the help......now it´s working well.

Share this post


Link to post
Share on other sites

Glad to be of service ;)


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

Share this post


Link to post
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
Sign in to follow this  
Followers 0