Jump to content
careca

Hide autoit created popup taskbar button

Recommended Posts

careca

Hi there, this is supposed to work as a toast, called by functions and such. Kinda looks like the windows 10 notification, as intended,

and the only problem is that i can't find a way to hide the taskbar button.

 

Opt("WinSearchChildren", 1)
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
HotKeySet("{ESC}", "Terminate")

Local $hParentWin, $hChildWin, $aMsg

$hParentWin = GUICreate("Parent GUI", 200, 100)
GUISetState(@SW_SHOW)

$hChildWin = GUICreate("Child GUI", 360, 65, @DesktopWidth + 400, @DesktopHeight - 106, $WS_POPUP, $WS_EX_APPWINDOW+$WS_EX_TOPMOST)
GUISetBkColor(0x1F1F1F, $hChildWin)
GUICtrlCreatePic(@ScriptDir&'\Info.bmp', 8, 8, 48, 48)
$Title = GUICtrlCreateLabel('Title', 70, 10, 250, 25)
GUICtrlSetFont($Title, 14, 900, 0, 'Arial', 5)
GUICtrlSetColor($Title, 0xFFFFFF)
GUICtrlSetBkColor($Title, 0x1F1F1F)
$Text = GUICtrlCreateLabel('Text', 70, 35, 250, 25)
GUICtrlSetFont($Text, 10, 600, 0, 'Arial', 5)
GUICtrlSetColor($Text, 0x707070)
GUICtrlSetBkColor($Text, 0x1F1F1F)
GUISetState(@SW_SHOW)

Show()

Func Show()
    WinMove($hChildWin, '', @DesktopWidth - 360, @DesktopHeight - 106, 360, 65, 1)
    ConsoleWrite('Show - ' & @MSEC & @CRLF)
EndFunc   ;==>Show

Func Hide()
    WinMove($hChildWin, '', @DesktopWidth + 400, @DesktopHeight - 106, 360, 65, 1)
    ConsoleWrite('Hide - ' & @MSEC & @CRLF)
EndFunc   ;==>Hide

While 1
    Sleep(300)
WEnd

Func Terminate()
    Exit
EndFunc   ;==>Terminate

 

Info.bmp

Edited by careca

Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
InunoTaishou

If you create a fake GUI and never set it to @SW_SHOW and set your real GUI to the child of the fake, the task bar button will never show up.

#include <GUIConstants.au3>

Global $frmFakeGUI = GUICreate("Fake GUI", 0, 0)
Global $frmRealGUI = GUICreate("Real GUI", 200, 100, -1, -1, -1, -1, $frmFakeGUI)
Global $lblMsg = GUICtrlCreateLabel("This is a GUI without a task bar icon", 10, 10, 180, 40)

GUICtrlSetFont($lblMsg, 12)

GUISetState(@SW_SHOW, $frmRealGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit 0
    EndSwitch
WEnd

 

  • Like 2

Share this post


Link to post
Share on other sites
careca

Awesome! Exactly what i was looking for! Although i think it would be nice to just have a flag to make it so, without playing those tricks, also i didn't see it in help file.

Best regards.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
BrewManNH

Instead of creating a hidden GUI you can always use the AutoIt hidden GUI that is created everytime you run a script. You can get an idea of how to interact with it by checking the help file for AutoItWinGetTitle.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
careca

Thanks BrewManNH, but whatever i do with AutoItWinGetTitle, the taskbar button appears as soon as i need to see the hidden window and call @SW_SHOW,

Maybe i just didn't understand where you're pointing?


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
BrewManNH

Take InunoTaishou's script, and instead of creating a new hidden GUI as his script does, you can use the one that AutoIt creates every time you run your script. Saves you from having to create unnecessary GUIs.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
InunoTaishou

Use WinGetHandle(AutoItWinGetTitle()) to get a handle to the AutoIt Window and use that handle instead of $frmFakeGUI

Share this post


Link to post
Share on other sites
BrewManNH

BTW InunoTaishou, that's a pretty slick way of doing that. I normally ended up using a popup style window or something similar.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites
careca

I incorporated the method in another script, where i do need both gui's. :)


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
InunoTaishou

Glad we were able to help!

  • Like 1

Share this post


Link to post
Share on other sites
Holger

To create something like an info window you only need the Windows ExStyle WS_EX_TOOLWINDOW.

You can combine the style WS_POPUP and WS_BORDER or just use WS_CAPTION as style.

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>

Dim $hGUI = GUICreate("MyGUI", 200, 80, -1, -1, BitOr($WS_BORDER, $WS_POPUP), $WS_EX_TOOLWINDOW)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    If $Msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

GUIDelete()

Exit

 

Share this post


Link to post
Share on other sites
careca

Nice. Thanks.


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

Share this post


Link to post
Share on other sites
Tiotua
On 6.1.2016 at 11:15 PM, InunoTaishou said:

If you create a fake GUI and never set it to @SW_SHOW and set your real GUI to the child of the fake, the task bar button will never show up.

#include <GUIConstants.au3>

Global $frmFakeGUI = GUICreate("Fake GUI", 0, 0)
Global $frmRealGUI = GUICreate("Real GUI", 200, 100, -1, -1, -1, -1, $frmFakeGUI)
Global $lblMsg = GUICtrlCreateLabel("This is a GUI without a task bar icon", 10, 10, 180, 40)

GUICtrlSetFont($lblMsg, 12)

GUISetState(@SW_SHOW, $frmRealGUI)

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit 0
    EndSwitch
WEnd

 

Wonderful. Exactly what I needed.  With

Global $frmRealGUI = GUICreate("Real GUI", 200, 100, -1, -1, $WS_SYSMENU, -1, $frmFakeGUI)

you'll get a GUI with only a close button (like a dialog box).

Edited by Tiotua
My text was inside quote ._.

Share this post


Link to post
Share on other sites
careca

9 months, just like a baby huh?

 


Spoiler

Paster - Main function is to paste text, but has more functions. (No longer mantained, switched to String Trigger)

Renamer - Rename files and folders, remove portions of text from the filename etc.

GPO Tool - Export/Import Group policy settings.

BeatsPlayer - Music player.

Params Tool - Right click an exe to see it's parameters or execute them.

String Trigger - Triggers pasting text or applications or internet links on specific strings.

Inconspicuous - Hide files in plain sight, not fully encrypted.

Regedit Control - Registry browsing history, quickly jump into any saved key.

Time4Shutdown - Write the time for shutdown in minutes.

Power Profiles Tool - Set a profile as active, delete, duplicate, export and import.

Firefox Profile Backup - Backup/restore previously saved profile.

Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes.

NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s.

IUIAutomation - Topic with framework and examples

Au3Record.exe

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

    • Dreamfire
      By Dreamfire
      Hi,
      Since today, exe's are being flagged as having a trojan by Windows Defender (Fuery.B!cl)
      Version:  3.3.14.3 - SciTE Version 3.7.3



       

    • PramodR
      By PramodR
      Hello,
      I have to execute below block of code in elevated previllage, as that particular wmic class will work only with admin previlage.
      i am getting out put when i launch autoit as administrator,  but i will not be able to launch autoit as admin in this particular case but my user have admin rights.
      is there any better way i can run those command as administrator.?
      tried below steps:
      i have tried #RequireAdmin but that creates a user prompt  Tried using Runas command but gives error as wrong username or password , stuck with that step.  
       
    • dwaynek
      By dwaynek
      traytip isn't working in windows 10. nothing happens when i use the Traytip command.
      here's a simple script i used:
      TrayTip("I'm a title", "I'm the message", 5) i tried changing the registry setting HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced ( which didn't have EnableBalloonTips) and creating a DWORD entry called EnableBalloonTips and setting it to 1 and logging off then back in. that did not resolve the problem.
      i'm running Windows 10 v1709 b16299.431
    • help_me_please
      By help_me_please
      Hello forum world,
      I am having an issue with a popup window displaying after selecting something using the ControlCommand( ) function.
      I am able to select the desired item from the dropdown list using the control command function but a popup window opens immediately after, not allowing the control command function to finish.
      Such as:
      ConsoleWrite("Before ControlCommand" & @CRLF)
      ControlCommand($Win_Name, "", $ID, "SelectString", $DropItemName)
      ConsoleWrite("After ControlCommand" & @CRLF)
       
      ^^^^
      So in the console I can get the "Before...", then the ControlCommand executes the selection of the dropdown menu.  Popup window opens
      But since there is a popup, I can not get the "After..." statement to write to the console. 
      This is where I am stuck, as I can not execute another command to close the popup window.
       
      Send help, oh gracious autoit forum.  
    • antonioj84
      By antonioj84
      Hi all to the forum guru and expert I am trying to  automate this. in the registry  I have the network profile name network 2 and network   I want to  change their  CATEGORY  to Private .  Can someone lead me in the right direction.
      Private is 1 and Public is 0
      #RequireAdmin Global $sHKLMRoot = @OSArch = "x64" ? "HKLM64" : "HKLM" RegWrite($sHKLMRoot &"\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkList\NewNetworks" ,'/v NetworkList /t REG_MULTI_SZ /d 00000000 /f') see  attached picture below
      Much appreaciate
       

×