Sign in to follow this  
Followers 0
elawady

tray proplem

12 posts in this topic

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

Share this post


Link to post
Share on other sites



up up

:):party::idea:

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

nah ... lets not be this impatient.

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

Jos

sorry

but i cant wait for the sol

i am sorry again

Edited by elawady

Share this post


Link to post
Share on other sites

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.


Visit the SciTE4AutoIt3 Download page for the latest versions  - Beta files                                How to post scriptsource        Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


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

Share this post


Link to post
Share on other sites

PsaltyDS,

Told you it would be obvious!

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

Jos,

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


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

Share this post


Link to post
Share on other sites

Change this:

Opt("TrayMenuMode", 1 + 2)

:)

thats very easy

thankuuuuuuuuuuuuu

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