Sign in to follow this  
Followers 0
OwenWatson

Console apps: no system tray?

8 posts in this topic

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



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

;)


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
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?

Share this post


Link to post
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?

;)

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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?

Share this post


Link to post
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?

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  
Followers 0