Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8957275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:57:05+00:00 2026-06-15T14:57:05+00:00

I have visual basic script that among other things creates IE instance, hides it,

  • 0

I have visual basic script that among other things creates IE instance, hides it, manipulates it and then make it visible to the user.

Unfortunately, the restore function does not work on all PCs for unclear reason. The current code is:

objectIE.Visible = True
wshShell.AppActivate objectIE 'which is I think wrong as objectIE is not PID.
wscript.sleep timoutSleep
wshShell.SendKeys restWindow 'which is "% r" and will not work on all locales :(

I think the problem is in this line:

wshShell.AppActivate objectIE

I think here I need to pass PID to the AppActivate method.

Question: How to get PID of the IE object? or wshShell.AppActivate objectIE is correct and I’m looking in a wrong direction?

P.S. I can’t use the application’s title as it is not unique 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T14:57:06+00:00Added an answer on June 15, 2026 at 2:57 pm

    You can call Win32 methods from PowerShell script using pInvoke.
    Examples of this all over the interwebs. For PostMessage there’s an example here:
    SendMessage is causing script to hang

    For this to work you would need to build up the lines of PSScript in a string and then execute it using e.g.
    powershell.exe -ExecutionPolicy Unrestricted -command "get-process -Name iexplore"

    And extract the resulting Ids, then send it to the script that calls PostMessage(), or even put all the commands into a single (short) script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some Visual Basic methods that are acting as the click handlers for
I have some visual basic script code in my installer and i need to
I have a Visual Basic 6.0 application that I want to install for All
I have never programmed in visual basic before and my boss just told me
I have a simple text reading code for Visual Basic: Dim fileReader As String
I am using visual basic for coding. In my form I have a delete
I have very little programming knowledge; only a fair bit in Visual Basic. How
I have written a basic Application for windows mobile 5. It is using visual
Goal: Provide a web service using Visual Basic or C# or .NET that interacts
I'm just getting started with Visual Studio (2010 Beta) and have some basic questions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.