Jump to content

How to disable system tray menu.


 Share

Recommended Posts

I am not positive that I am reading your question correctly but, if I am, you are trying to hide certain icons from the sys tray.... Did you know you can do this natively via the taskbar settings? Check "Hide inactive icons"> goto "Customize" and you can tell it to hide certain programs or hide when inactive or show.... hope this helps.

I would assume that this is somewhere in the registry also, incase you wanted to do it in AutoIt alone (but im at work, so that research is for you LOL :rolleyes:)

Edited by danwilli
Link to comment
Share on other sites

Thanx for you reply. I'm meaning something else then you answerd.

If you right click on a icon most icons in the taskbar popup with a menu. What i want is to disable, de menu from popping up.

Edited by EDD
Link to comment
Share on other sites

Thanx for you reply. I'm meaning something else then you answerd.

If you right click on a icon most icons in the taskbar popup with a menu. What i want is to disable, de menu from popping up.

Opt("TrayMenuMode", 1)

:rolleyes:

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
Link to comment
Share on other sites

I do not think that such is possible - but why would you want to do that?

I'm working for a company with several shops. I don't want that it's possible for them to change the configuration of a program trough the system tray icon. because if they do the change is big that it wont function correcly anymore.

Link to comment
Share on other sites

I'm working for a company with several shops. I don't want that it's possible for them to change the configuration of a program trough the system tray icon. because if they do the change is big that it wont function correcly anymore.

Good reason - the only work around that I can think of is very crude, but might work for you. Constantly check the mouse position - if it goes into the system tray region, create a SplashTextOn with a warning. They will not be able to click thru the splash screen.

I'm not sure if there is a UDF that will tell you the current size of the system tray... but that would come in handy for my work around.

...hope this helps...

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

I dont think you can do that, the splash text on box wont show ontop of the taskbar,

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

I think this might be a little better, that is, using HereWasPlato's Idea

It has a TrayTip, so there has to be an Icon, however, you can get rid of the icon by taking away the " ; " infront of AutoItSetOption

_BlockSysTray( [Tip Title] , [Tip Text] )

#include <GuiConstants.au3>
;AutoItSetOption("TrayIconHide",1)
Func _BlockSysTray($bTitle,$bText)
    $Pix1=PixelSearch(0,0,@DesktopWidth,@DesktopHeight,1886455)
    $Coord1=@DesktopWidth -$Pix1[0]
    $Coord2=@DesktopHeight -$Pix1[1]
    GUICreate("Block",$Coord1 + 10,$Coord2, $Pix1[0]-10,$Pix1[1],$WS_POPUP,$WS_EX_TOOLWINDOW)
    GuiSetState()
    WinSetOnTop("Block","",1)
    WinSetTrans("Block","",10)
While 1
    $Pixel=MouseGetPos()
    If $Pixel[0] > $Pix1[0] Then
        If $Pixel[1] > $Pix1[1] Then
        TrayTip($bTitle,$bText,3)
    EndIf
    EndIf
    WinSetOnTop("Block","",1)
    Sleep(500)
WEnd
EndFunc

I just whipped this up in like 15 mins so it may contain bugs, I did this because I have a similar goal, hope it helps! This is on Windows XP Blue Theme, to change this script, use the autoit info to find the pixel color on the top left of the system tray, but this is only if you have something else =P

Cheers, MethodZero

Edited by MethodZero

[center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center]

Link to comment
Share on other sites

I dont think you can do that, the splash text on box wont show ontop of the taskbar,

It will show on top of mine, what I did not test was clicking elsewhere on the taskbar brings it to the foreground over the splashscreen.

GUI to the rescue :-)

[size="1"][font="Arial"].[u].[/u][/font][/size]

Link to comment
Share on other sites

  • 2 weeks later...

Thanx all for your sugestions and scripts. I fixed my problem sometime ago end did not post it here, shame on me :whistle: It's not full proof but if you dont know the trick you won't be able to get to the menu.

;DISABLE RIGHT CLICK ICON <<begin>>
    If _IsPressed("02") = 1 Then
        $iProcesses = _SysTrayIconProcesses()
        For $i=0 to Ubound($iProcesses)-1
            if $iProcesses[$i] = "fax.exe" Then
                $process = $iProcesses[$i]
            EndIf
        Next
        
        $icon = _SysTrayIconIndex($process)
        $positie = _SysTrayIconPos($icon)
        
        $mouse = MouseGetPos()
        If $mouse[0] > $positie[0] -5 and $mouse[0] < $positie[0] + 22 Then 
            If $mouse[1] > $positie[1] -5 and $mouse[1] < $positie[1] + 22 Then
                While 1
                    If _IsPressed("02") = 0 Then
                        Send("{esc}")
                        ExitLoop
                    EndIf
                WEnd
            EndIf
        EndIf
    EndIf
;DISABLE RIGHT CLICK ICON <<einde>>

The only hole in this script is if you right click your mouse and you move your mouse on some places around the icon in the taskbar the menu gets still visible. You also see if you right click on the icon sometimes a split second the menu.

Mmmhhh now i'm thinking about it....

I can fix the hole. If people right click on the icon and i disable them from not going outside area, the problem is fixed :lmao:

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