Jump to content

How to disable button&icon in task bar and tray?


Recommended Posts

Hi guys. Before you tell me "read help!" or something like that :lmao: I already read the AutoIt help, searched this forum and I was able to create an application with hidden tray and task bar icon. So there is not a problem with that. But there is a problem if I use a message box inside that app.

The application is running as a child window of another application. When the message box is started a button with icon is shown in task bar and it's hidden when the message box is closed. But I really don't like this behavior. Do you think there is a solution (except to create my own MsgBox via custom GUI)?

Thank you in advance for any suggestion!

Here is the code of my app (only the necessary required code). Simply run it (no button/icon is shown) and press the button (button in task bar is shown)..

#NoTrayIcon
#include <GUIConstants.au3>
$handle = WinGetHandle("Welcome!")
GUICreate("Test app...", 135, 160, -1, -1,$DS_MODALFRAME,$WS_EX_TOOLWINDOW,$handle)

$button1= GUICtrlCreateButton("1", 5, 5, 30, 30)
GuiSetState()

; Run the GUI until the dialog is closed
While 1
    $msg = GUIGetMsg()
      Select
         Case $msg = $button1
             MsgBox(4096, "Title", $handle)
      EndSelect
   If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend
Edited by odklizec
Link to comment
Share on other sites

...........

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Link to comment
Share on other sites

My idea is pretty bad...

Have the message box be another script, which is called by the first.

It will share the message box result as a file or somesuch.

J

If I am too verbose, just say so. You don't need to run on and on.

Link to comment
Share on other sites

Everything except the timeout parameter:

_MsgBoxEx(4096,"Example","Message box without a taskbar button!")
Exit

Func _MsgBoxEx($flag, $title, $text)
    $dummy = GuiCreate("Dummy")
    Local $result = DllCall("user32.dll", "int", "MessageBox", "hwnd", $dummy, _
                            "str", $text, "str", $title, "int", $flag)
    GuiDelete($dummy)
    Return $result[0]
EndFunc

Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
Link to comment
Share on other sites

Everything except the timeout parameter:

_MsgBoxEx(4096,"Example","Message box without a taskbar button!")
Exit

Func _MsgBoxEx($flag, $title, $text)
    $dummy = GuiCreate("Dummy")
    Local $result = DllCall("user32.dll", "int", "MessageBox", "hwnd", $dummy, _
                            "str", $text, "str", $title, "int", $flag)
    GuiDelete($dummy)
    Return $result[0]
EndFunc
Great!! It's exactly what I look for! Thank you! Just one thing..do you think there is an option to change the MsgBox title bar icon?
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...