Jump to content

tray proplem


Recommended Posts

Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
TraySetClick(16)

$trayitem = TrayCreateItem("now")
TrayItemSetOnEvent(-1,"autostart")
WinWaitActive("","fkdhfsdjs")

Func autostart()
    $msg=TrayItemGetState ( $trayitem )
    MsgBox(64,"d",$msg)
While 1
    Select
    Case $msg=65
         TrayItemSetState ($trayitem,68)
         Return
    Case $msg=68
         TrayItemSetState ($trayitem,65)
         Return
     EndSelect
WEnd
EndFunc

why it cant return unchecked

Link to comment
Share on other sites

  • Developers

up up

:):party::idea:

nah ... lets not be this impatient.

Bumping a thread within 24 hours isn;t appreciated around here.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Developers

sorry

but i cant wait for the sol

i am sol

Well better be patient because else we will help you to.

Anyways, i have no idea what you are asking nor what you are trying to accomplish with this script.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

  • Moderators

elawady,

Very interesting problem- thanks for raising it. You get the correct return from TrayItemGetState if the item is not the one being actioned. When used on the actioned item, it always appears to return UNCHECKED - this is slightly modified from the TrayItemSetState example in the Help file:

#Include <Constants.au3>
#NoTrayIcon

Opt("TrayMenuMode",1)  ; Default tray menu items (Script Paused/Exit) will not be shown.

$chkitem        = TrayCreateItem("Check it")
TrayCreateItem("")
$checkeditem    = TrayCreateItem("Checked")
TrayCreateItem("")
$exititem      = TrayCreateItem("Exit")

TraySetState()

While 1
    $msg = TrayGetMsg()
    Select
        Case $msg = $chkitem
            ConsoleWrite("Read Check  " & TrayItemGetState($checkeditem) & @CRLF)
            ConsoleWrite("Read Action " &TrayItemGetState($chkitem) & " This is always 68" & @CRLF)
            If TrayItemGetState($checkeditem) = $TRAY_ENABLE + $TRAY_CHECKED Then
                TrayItemSetState($checkeditem, $TRAY_ENABLE + $TRAY_UNCHECKED)
                TrayItemSetState($chkitem,   $TRAY_ENABLE + $TRAY_UNCHECKED)
                ConsoleWrite("Set Check   " & TrayItemGetState($checkeditem) & @CRLF)
                ConsoleWrite("Set Action  " &TrayItemGetState($chkitem) & " But this is not" & @CRLF & @CRLF)
            Else
                TrayItemSetState($checkeditem, $TRAY_ENABLE + $TRAY_CHECKED)
                TrayItemSetState($chkitem,   $TRAY_ENABLE + $TRAY_CHECKED)
                ConsoleWrite("Set Check   " & TrayItemGetState($checkeditem) & @CRLF)
                ConsoleWrite("Set Action  " &TrayItemGetState($chkitem) & " But this is not" & @CRLF & @CRLF)
            EndIf

        Case $msg = $exititem
            ExitLoop
    EndSelect
WEnd

Or am I missing something extremely obvious? :-)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Opt("TrayOnEventMode",1)
Opt("TrayMenuMode",1)
TraySetClick(16)

$trayitem = TrayCreateItem("now")
TrayItemSetOnEvent(-1,"autostart")
WinWaitActive("","fkdhfsdjs")

Func autostart()
    $msg=TrayItemGetState ( $trayitem )
    MsgBox(64,"d",$msg)
While 1
    Select
    Case $msg=65
         TrayItemSetState ($trayitem,68)
         Return
    Case $msg=68
         TrayItemSetState ($trayitem,65)
         Return
     EndSelect
WEnd
EndFunc

why it cant return unchecked

Change this:
Opt("TrayMenuMode", 1 + 2)

:)

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

  • Moderators

PsaltyDS,

Told you it would be obvious!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

  • Moderators

Jos,

And I thought the Dutch were the master linguists in Europe.... ;-)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

I have to say your interpreters are working well today figuring out what the OPs question was. :party:

It's the Grandchildren. They force you to re-learn your gibberish from when your own kids where that age.

:)

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

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