Juvigy

IE and IE add-in

9 posts in this topic

 Hi Guys,

I have and autoit exe file that i want to be executed every time IE is opened. How can i accomplish this ?

The exe file automates website data. I want to be sure that the exe file is executed every time IE is Opened automatcally.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

As there is no guidance , i decided to try to create a IE BHO with visual studio in C++.  Final product will be a DLL that is registered into a IE Add-in.
As my C++ is practically missing , any help is much appreciated.
 Here is the base i am using:

https://msdn.microsoft.com/en-us/library/bb250489%28v=vs.85%29.aspx

Edited by Juvigy
Spell check

Share this post


Link to post
Share on other sites

I am almost ready , but i cant fix a small bump and i cant figure out why - it should be very easy but still it doesnt work. I use this to start up notepad for test purposes:

CreateProcess(TEXT("C:\\windows\\notepad.exe"), NULL, NULL, NULL, NULL, NULL, NULL, NULL, &si, &pi);

Which works great. But later on i cant close this. I tried :
 

PostMessage(pi.hProcess, WM_CLOSE, 0, 0);
PostThreadMessage(pi.dwThreadId, WM_CLOSE, ...
TerminateProcess(pi.hProcess, 0)

Nothing works. I put a msgbox just before to verify it is executed - the msgbox appears. Any idea why this happens ? I know it is C++ code , but it is related to AutoIT script and i know there are people here who know a lot of C++ :)

Share this post


Link to post
Share on other sites

I think you missed my point - i dont want to catch the creation of new IE window - i want Internet Explorer to start my script every time IE is started.

Share this post


Link to post
Share on other sites

But if you have a script which knows, ie is started you can also start your mainscript.

Share this post


Link to post
Share on other sites

I can go that way - to have one main script started as a service which monitors IE process and start/close the IE manipulation script. But IE Add-on seemed more elegant solution.

Share this post


Link to post
Share on other sites

I want when a page is open in IE - lets say "google.com" , the script to start and automate things. Ideally the script should be closed if the IE page is not opened. I dont want to start the script manually and the script to start the IE. I want ideally the other way around - IE to start the script. The closest thing to that is a master script running all the time as service and monitoring IE pages, so i have decided to go that way.

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

  • Similar Content

    • Eggsplorer
      By Eggsplorer
      Hi,
      Ich hab ein Script für Windows Updates, dass nach dem OOBE aufgerufen werden soll. Run/RunOnce ist daher nicht möglich.
      Stattdessen möchte ich das Script in den Autostart schreiben lasse. Wenn die OOBE beendet wird und der Administrator angemeldet wird, soll das Update-Script einmalig aufgerufen werden und sich anschl. selbst löschen.
      Lang rede, kurzer Sinn:
      Wie kann ich folgendes Script in den Autostart schreiben?
      RunWait(@ComSpec & " /c " & "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -File C:\UA\Scripts\win-updates.ps1 -MaxUpdatesPerCycle 100 -RestartRequired 1", "") Ich würde ungern eine BAT oder EXE reinkopieren, da ich es unsauber finde. Die müsste ja auch zusätzlich irgendwo liegen.
      Danke
      Eggsplorer
    • PELock
      By PELock
      I'm trying to use #OnAutoItStartRegister to modify the Global variable, but it seems it doesn't work, is that on purpose, that those callback functions cannot modify anything except in their own scope?
    • Caster
      By Caster
      Well, I am pretty sure this is possible. I have seen many solutions for this, but I couldn't understand how to configurate it.

      I have a Minecraft CraftBukkit server, but I want to automatize it a bit. Something like this:

      10:00: Wake up pc from hybernating, and start 2 servers (they have both this CMD "gui").
      After starting: Type 'save-all' (without the quotes) in both CMD's every 15 minutes until 13:00
      13:00: Type 'broadcast Restarting server!' in both CMD's
      13:02: Type 'stop' in both CMD's
      13:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc.
      After restart: Start both servers.
      After starting: Type 'save-all' in both CMD's every 15 minutes until 16:00
      16:00: Type 'broadcast Restarting server!' in both CMD's
      16:02: Type 'stop' in both CMD's
      13:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc.
      After restart: Start both servers.
      After starting: Type 'save-all' in both CMD's every 15 minutes until 20:00
      20:00 Type 'broadcast Restarting server!' in both CMD's
      20:02 Type 'stop' in both CMD's
      20:04: Press the ENTER button in both CMD's, wait 5 seconds and restart the pc.
      After restart: start both servers.
      After starting: Type 'save-all' every 15 minutes in both CMD's until 01:00
      01:00 Type 'broadcast STOPPING SERVER!' in both CMD's
      01:02 Type 'stop' in both CMD's
      01:04 Press the ENTER button in both CMD's, wait 5 seconds and set the pc to hybernate, and repeat the sequence (the pc wakes up at 10:00 again).

      What I would like, is a clear optin/config in the beginning of the file or something where I can set when the server should start and stop (e.g $start=10:00; $stop=01:00) and when it should restart (e.g $restart=13:00;16:00;20:00) if that is possible.

      If anyone can make a script like that for me, then I would be very happy. I have never used AutoIt before, I was just recommended by a friend about it.

      -CasterAnd