Jump to content

hide taskbar from external program!


Rudex
 Share

Recommended Posts

Hi,

I want to remove the taskbar from one external program that i am automating with autoit.

I have the problem that when I execute the program with command Run, appear 2 previous windows before to the main program window.

In these two windows I need to accept and push ok. When I use the code below at the first window it works fine. But when appear the second appear again the taskbar program icon.

And when click again, appear again until the main window appear and then i can remove it. again.

#include <GuiToolBar.au3>

; Run Software with the window normal.
Run("C:\MYPROGRAM.exe", "", @SW_SHOWNORMAL)

WinWaitActive("[CLASS:TFormActivation]", "", 10)
;Sleep(2000)

$hParent = WinGetHandle("[Class:Shell_TrayWnd]")
$hToolBar = ControlGetHandle($hParent, "", "ToolbarWindow322")
$ButtonText = "MY PROGRAM NAME" ; Taskbar title

$count = _GUICtrlToolbar_ButtonCount($hToolBar)


;_GUICtrlToolbar_SetButtonState($hToolBar, 6, $TBSTATE_HIDDEN)
For $i = 1 To $count - 1 Step 2
    $ID = _GUICtrlToolbar_IndexToCommand($hToolBar, $i)
    
    If StringInStr(_GUICtrlToolbar_GetButtonText($hToolBar, $ID), $ButtonText) Then
        _GUICtrlToolbar_SetButtonState($hToolBar, $ID, $TBSTATE_HIDDEN)
        ExitLoop
    EndIf
Next

Any way to to this code with one loop until after appear the main program window?. For loop or similar to while the code of script is executing the loop will check constantelly if the window appear again...

 

And another thing. Are there any way to hide completely the window?. It appears  around 1 second and later hide it.  I would like the window no appear any time. is not it possible with autoit?.

Regards.

 

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...