Jump to content

Activate App and Maximize it from another App

Recommended Posts

Hi am new. My first post so please be nice.

I have created an App in VB6 that interfaces with Photoshop Vbscript. It works fine with Photoshop but when Photoshop window is minimized I can't get it to maximize. I had tried different strings using Sendkeys to navigate but it won't work as long as the calling App is still running. If I send the strings from  VB6 in intermediate window then Photoshop will maximize. I was wondering if there is another way besides using Sendkeys in Vbscript?

These are the scripts I use with Sendkeys:

Dim shs

Dim flg as boolean

Dim objApp

Set shs = CreateObject( "wscipt.shell")

Set objApp = CreateObject(" Photoshop.Application ")

Rem Photoshopflag is set from another function

 If Photoshopflag = True then

   If objApp.Activedouments.count  <> 0 Then



        shs.Sendkeys "%{TAB}" 

        Pause 5

         Rem next line is sending Enter as insurance

         shs.Sendkeys "{ENTER}"

          Pause 5

          flg = shs.AppActivate(ObjApp.Activedocument.name)

          Pause 5  

        Loop Until flg = True

      End If

    End If

The procedure gets in the loop but I can see the Photoshop icon in the task bar getting highlighted. If I  break inside the loop then Photoshop is maximized.




Link to post
Share on other sites
  • Moderators

@LuisF welcome to the forum. Please be aware (hopefully I am stating the obvious) that you have posted on an AutoIt language forum, not a VBScript forum. Don't be surprised if the answers you get run in the vein of "Why use a dead language, here's how to do it with AutoIt..." :)

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

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
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...