Jump to content
Sign in to follow this  
OwenWatson

Console apps: no system tray?

Recommended Posts

OwenWatson

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?

Share this post


Link to post
Share on other sites
gte

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?

Share this post


Link to post
Share on other sites
OwenWatson

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?

;)

Share this post


Link to post
Share on other sites
ResNullius

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.

Share this post


Link to post
Share on other sites
OwenWatson

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.

Share this post


Link to post
Share on other sites
ResNullius

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?

Share this post


Link to post
Share on other sites
OwenWatson

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?

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
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.