Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Tray functions and variables
#1
Hey, need any example how to pass variables to callback function in Tray.AddIcon instead of global variables usage(if possible). Looking into Tray_sample_use_function example
#2
Macro Macro2511
Code:
Copy      Help
;Adds tray icon and stays running.
;Sub-function TrayProc is called on mouse events.

if(getopt(nthreads)>1) ret

type VARIABLES_53946g x str's
VARIABLES_53946g k
k.x=74

Tray t.AddIcon("notepad.exe" "QM - run Notepad" 0 &sub.TrayProc &k)
MessageLoop


#sub TrayProc
function Tray&tray msg

VARIABLES_53946g& k=+tray.param
sel msg
,case WM_LBUTTONUP
,sel GetMod
,,case 0
,,out k.x
,,run "notepad.exe"
,,case 2 shutdown -7
,
,case WM_RBUTTONUP
,sel ShowMenu("1 Run notepad[]2 Exit")
,,case 1 run "notepad.exe"
,,case 2 shutdown -7

or

Macro Macro2512
Code:
Copy      Help
;Adds tray icon and stays running.
;Sub-function TrayProc is called on mouse events.

if(getopt(nthreads)>1) ret

type Tray_53946g :Tray'_ x str's
Tray_53946g t
t.x=74

t.AddIcon("notepad.exe" "QM - run Notepad" 0 &sub.TrayProc)
MessageLoop


#sub TrayProc
function Tray_53946g&t msg

sel msg
,case WM_LBUTTONUP
,sel GetMod
,,case 0
,,out t.x
,,run "notepad.exe"
,,case 2 shutdown -7
,
,case WM_RBUTTONUP
,sel ShowMenu("1 Run notepad[]2 Exit")
,,case 1 run "notepad.exe"
,,case 2 shutdown -7
#3
nice, thx Big Grin


Forum Jump:


Users browsing this thread: 1 Guest(s)