Posts: 153
Threads: 33
Joined: Aug 2009
Hi Gint !
I would like to have the option to open/reopen my Main dialog by using Tray icon.
i was wondering how to "close" the dialog and "save" its current state...?
for example ;
Dialog has a start/stop button ,i hit start ,i close dialog and reopen it by using the tray icon.
How to keep the button pushed/showing right text?
my first idea
I thought to check running functions below WM_INITDIALOG and set button text (start,stop) based on that.
well thats the "i want to get it running" idea :lol:
im sure theres a better way!?
Thanks alot
Posts: 153
Threads: 33
Joined: Aug 2009
Function
Dialog223
Trigger
F3
,case IDCANCEL
,hid hDlg
,ret 0
Function
TrayProc
;/
function Tray&tray msg
sel msg
,case WM_LBUTTONUP
,,hid- "Dialog"
that would work ,well would modify Tray proc to see if dialog function is running .. if is running unhide else rund the function...
Posts: 12,073
Threads: 140
Joined: Dec 2002
Correct.
Other version.
Function
dialog_tray_icon
\Dialog_Editor
function# hDlg message wParam lParam
if(hDlg) goto messages
if(!ShowDialog("dialog_tray_icon" &dialog_tray_icon 0)) ret
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 223 135 "Dialog"
;2 Button 0x54030000 0x4 120 116 48 14 "Hide"
;3 Button 0x54032000 0x0 172 116 48 14 "Exit"
;END DIALOG
;DIALOG EDITOR: "" 0x2030300 "*" "" ""
ret
;messages
sel message
,case WM_INITDIALOG
,Tray-- t_ti
,t_ti.AddIcon("$qm$\copy.ico" "tooltip" 5 hDlg)
,;clo hDlg ;;hide
,
,case WM_DESTROY
,t_ti.Delete
,
,case WM_USER+101
,sel lParam
,,case WM_LBUTTONUP ;;on left click tray icon
,,;gShow
,,act hDlg; err
,,
,,case WM_RBUTTONUP ;;on right click tray icon
,,sel ShowMenu("1 Show[]2 Exit" hDlg)
,,,case 1 goto gShow
,,,case 2 goto gExit
,
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDCANCEL ;;Hide, X
,min hDlg; hid hDlg; ret
,
,case 3 ;;Exit
,;gExit
,DT_Cancel hDlg
ret 1
Posts: 153
Threads: 33
Joined: Aug 2009
So basically my idea was right but to be honest i was far away from your code...
i used the example thats in system folder (Tray_sample_use_function + TryProc + my Dialog) so i already had 3 functions constantly running... didnt think of having it all in the dialog. Thats very nice!
Well it always amazing to see your Ideas !!
I just dont understand why it doesnt need a Messageloop in Dialog ?
best regards.
Posts: 12,073
Threads: 140
Joined: Dec 2002
The message loop is deep in ShowDialog.