Jump to content

Console apps: no system tray?


Recommended Posts

Thinking that this might be a feature request: if not, please let me know.

I've transformed my script to a console .exe file. I see that there are switches you can use if you run the exe from autoit so no system tray icon appears: however, I'd like to distribute a .exe file that doesn't require autoit.

Can this be done?

Link to comment
Share on other sites

I'm not sure what you mean by "I'd like to distribute a .exe file that doesn't require autoit" but you can definitely compile it to not have a tray icon, and to have a different icon for the executable itself

Thinking that this might be a feature request: if not, please let me know.

I've transformed my script to a console .exe file. I see that there are switches you can use if you run the exe from autoit so no system tray icon appears: however, I'd like to distribute a .exe file that doesn't require autoit.

Can this be done?

Link to comment
Share on other sites

Yes. I tested it; it's called many times in a tight loop by another program so it's quite visible when it runs (the icon flashes up in the system tray every time it runs). I recompiled it with the Opt option and that didn't make any difference (from the Opt docs: "Note: The icon will still initially appear ~750 milliseconds")

I'm trying to have nothing show in the system tray when it runs.

Well, did you test it? What happens when you put Opt("TrayIconHide", 1) in your script and compile it?

;)

Link to comment
Share on other sites

Yes. I tested it; it's called many times in a tight loop by another program so it's quite visible when it runs (the icon flashes up in the system tray every time it runs). I recompiled it with the Opt option and that didn't make any difference (from the Opt docs: "Note: The icon will still initially appear ~750 milliseconds")

I'm trying to have nothing show in the system tray when it runs.

Check out the #NoTrayIcon compiler directive under Keyword/Statement Reference in the help file.

Link to comment
Share on other sites

Tried that: didn't work.

FYI: Here's the script:

#NoTrayIcon

$attribute = FileGetAttrib($CmdLine[1])

If @error Then

;doesn't exist

$type = -1

Else

If StringInStr($attribute, "D") Then

;directory

$type = 0

Else

;file

$type = 1

EndIf

EndIf

ConsoleWrite ($type)

Check out the #NoTrayIcon compiler directive under Keyword/Statement Reference in the help file.

Link to comment
Share on other sites

Tried that: didn't work.

FYI: Here's the script:

#NoTrayIcon

$attribute = FileGetAttrib($CmdLine[1])

If @error Then

;doesn't exist

$type = -1

Else

If StringInStr($attribute, "D") Then

;directory

$type = 0

Else

;file

$type = 1

EndIf

EndIf

ConsoleWrite ($type)

I compile that exact code as a CUI, call it in a tight loop from another program feeding it list of files and never once get a flash of the tray icon.

Perhaps it your "other" program's icon, or something else going on?

What version of Windows and what version of AutoIt are you using?

Link to comment
Share on other sites

You are right. My apologies: there must be something else going on.

I compile that exact code as a CUI, call it in a tight loop from another program feeding it list of files and never once get a flash of the tray icon.

Perhaps it your "other" program's icon, or something else going on?

What version of Windows and what version of AutoIt are you using?

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