Posts: 1,271
Threads: 399
Joined: Mar 2003
qm taskbars for two monitors.
this is a development thread, attached files are only for demonstration.
You can find the current state of the package here .
obsulete:
fixed: why doesn't qm show up on one of my taskbars ?
fixed: do you know a way to show the windows start menu at mouse position ?
fixed: on my vista when using ini for toolbar settings are saved in the windows dir
fixed: 'TB_AdjustSize', how to use this for only horizontal resize ?
fixed: the user picture window does not exist on classic menu, and hid throws error
Attached Files
2 taskbars.qml (Size: 6.45 KB / Downloads: 704)
Posts: 1,271
Threads: 399
Joined: Mar 2003
why doesn't qm show up on one of my taskbars ?
str s tb1 tb2 title cls exe; int hwnd htb1 htb2
ARRAY (int ) handles
GetWindowList 0 "" 0 0 0 handles
tb1=
;;/hook _taskbar_hook /ini taskbar1.ini
;Close :clo win(mouse) *close.ico
;-
tb2=
;;/hook _taskbar_hook /ini taskbar2.ini
;Close :clo win(mouse) *close.ico
;-
for (int 'i 0 handles.len)
, hwnd=handles[i]
, if (!IsWindowVisible (hwnd)) continue ;;exclude hidden
, if (GetWinStyle (hwnd 1)&WS_EX_TOOLWINDOW ) continue
, exe.getwinexe(hwnd 1)
, title.getwintext(hwnd)
, cls.getwinclass(hwnd)
, title.findreplace(":" " ") ;;escape :
, title.escape(1) ;;escape "
, if taskbar_splitter (hwnd)==1
,, tb1.formata("%s :_taskbars_func(1 %i); err * %s[]" title hwnd exe)
, else
,, tb2.formata("%s :_taskbars_func(1 %i); err * %s[]" title hwnd exe)
,
,
htb1=win ("TASKBAR_1" "QM_Toolbar")
htb2=win ("TASKBAR_2" "QM_Toolbar")
if (htb1) tb1.setmacro("\2 taskbars\toolbars\taskbar_1")
else htb1=DynamicToolbar (tb1 "\2 taskbars\toolbars\taskbar_1")
if (htb2) tb2.setmacro("\2 taskbars\toolbars\taskbar_2")
else htb2=DynamicToolbar (tb2 "\2 taskbars\toolbars\taskbar_2")
found the problem, there is no new line after -
tb1=
;;/hook _taskbar_hook /ini taskbar1.ini
;Close :clo win(mouse) *close.ico
;-
how to use newline in a multiline variable ?
Posts: 12,147
Threads: 143
Joined: Dec 2002
Add one more line containing just single space character.
Posts: 1,271
Threads: 399
Joined: Mar 2003
do you know a way to show the windows start menu at mouse position ?
Posts: 12,147
Threads: 143
Joined: Dec 2002
no, only this:
spe
key W
;int h=wait(10 WV win("" "BaseBar" "" 128 0x94800000 0)) ;;classic
int h=wait (10 WV win ("" "DV2ControlHost")) ;;XP/Vista
mov 300 0 h
Posts: 1,271
Threads: 399
Joined: Mar 2003
well in alpha stage i can live with it, though on my vista config the
'Desktop User Picture' class is overlapping.
so i hide it.
spe
key W
int h=wait (10 WV win ("" "DV2ControlHost")) ;;XP/Vista
int uph=win ("" "Desktop User Picture")
mov 300 0 h
hid uph
another question, on my vista when using ini for toolbar settings are saved in the windows dir
and not as expected in My QM\toolbars.
Posts: 12,147
Threads: 143
Joined: Dec 2002
Make sure it is like
/ini "$my qm$\toolbars.ini"
, but not
/ini $my qm$\toolbars.ini
and not
/ini "toolbars.ini"
Posts: 1,271
Threads: 399
Joined: Mar 2003
for ken you made function 'TB_AdjustSize',
can you show me how to use this for only horizontal resize ?
tb height is only one line.
Posts: 12,147
Threads: 143
Joined: Dec 2002
In hook function:
, case WM_INITDIALOG
, SetWinStyle id (9999 hWnd) TBSTYLE_WRAPABLE 2
Posts: 12,147
Threads: 143
Joined: Dec 2002
Or use updated TB_AdjustSize with flag 1.
Auto toolbar height
Posts: 1,271
Threads: 399
Joined: Mar 2003
updated the upload.
current version is 0.03.
if you got some time please take a look on it and tell me
what you do think ?
Posts: 12,147
Threads: 143
Joined: Dec 2002
This is how to detect classic start menu
spe
key W
int h
if (_winver<0x501 or (rget (_s "ShellState" "Software\Microsoft\Windows\CurrentVersion\Explorer" 0 "" REG_BINARY ) and _s[32]&2=0)) ;;classic
, h=wait (10 WV win ("" "BaseBar" "" 128 0x94800000 0))
else ;;XP/Vista
, h=wait (10 WV win ("" "DV2ControlHost"))
mov xm ym h
Posts: 12,147
Threads: 143
Joined: Dec 2002
the user picture window does not exist on classic menu, and hid throws error
_taskbars_func
;/
function action hWnd
int hwnd=win ()
sel action
, case 0;; windows start menu
,, spe
,, key W
,, int h
,, if (_winver<0x501 or (rget (_s "ShellState" "Software\Microsoft\Windows\CurrentVersion\Explorer" 0 "" REG_BINARY ) and _s[32]&2=0)) ;;classic
,,, h=wait (10 WV win ("" "BaseBar" "" 128 0x94800000 0))
,, else ;;XP/Vista
,,, h=wait (10 WV win ("" "DV2ControlHost"))
,,, int uph=win ("" "Desktop User Picture")
,,, hid uph; err
,, mov xm -18 ym +18 h
, case 1;; left click
,, if hwnd==hWnd
,,, min hWnd
,, else
,,, act hWnd
,,
Posts: 1,271
Threads: 399
Joined: Mar 2003
thanks. uploaded v0.04
how to avoid flicker when adding taskbars_main to init2 ?
Posts: 12,147
Threads: 143
Joined: Dec 2002
You can't avoid it when using standard QM toolbar.
--
When there are many windows, window buttons are in second row, invisible. Probably QM limits toolbar width. Toolbar itself is too wide.
----
Using QM toolbar for this maybe is easier (until some time), but is too dirty, unreliable, unstable, restricting.
Dirty - you have to periodically replace toolbar text. Normally you would only have to add/remove single button, but you cannot do it with QM toolbars.
Unreliable - toolbar behavior may change in future QM versions, breaking your toolbar-taskbar.
Unstable - the code runs in QM thread. Any bug or unexpected condition can make QM unstable.
Restricting - see dirty, etc.
Posts: 1,271
Threads: 399
Joined: Mar 2003
so the only alternative i see is to use dialogs instead.
Posts: 12,147
Threads: 143
Joined: Dec 2002
Dialogs also have some restrictions. They are easier to use when you need many controls. In this case, only single ToolbarWindow32 control can be enough. I would create window class and have full control. See 'Hello World' in samples2.qml.
Posts: 1,271
Threads: 399
Joined: Mar 2003
ok, i use a copy of the
Explorer-style dialog example.
how do i open two dialog at once ?
i need two dialogs (left and right screen) for two taskbars.
Posts: 12,147
Threads: 143
Joined: Dec 2002
mac "functionthatopens1dialog"
mac "functionthatopens1dialog"
Dialogs will run in separate threads. Do you need them to run in same thread?
Posts: 1,271
Threads: 399
Joined: Mar 2003
Gintaras Wrote: Do you need them to run in same thread?
no, thats fine.
my main function is now:
TSK_Main
mac "TSK_functions"
mac "TSK_open1"
mac "TSK_open2"
how do is start TSK_functions in an own thread with 3s repeat ?
TSK_functions
out
int um_hwnd=win ("" "UltraMon Taskbar")
str s tb1 tb2 title cls exe; int hwnd htb1 htb2
ARRAY (int ) handles
GetWindowList 0 "" 0 0 0 handles
for (int 'i 0 handles.len)
, hwnd=handles[i]
, if (!IsWindowVisible (hwnd)) continue ;;exclude hidden
, if (GetWinStyle (hwnd 1)&WS_EX_TOOLWINDOW ) continue
, exe.getwinexe(hwnd 1)
, title.getwintext(hwnd)
, cls.getwinclass(hwnd)
, title.findreplace(":" " ") ;;escape :
, title.escape(1) ;;escape "
, title.left(title 24)
, if taskbar_splitter (hwnd)==1
,, tb1.formata("%s - hwnd=%i[]" title hwnd)
, else
,, tb2.formata("%s - hwnd=%i[]" title hwnd)
,
out "left:[]%s[]right:[]%s" tb1 tb2
Attached Files
Taskbars.qml (Size: 5.12 KB / Downloads: 1,003)
Posts: 12,147
Threads: 143
Joined: Dec 2002
Posts: 12,147
Threads: 143
Joined: Dec 2002
Better run everything in single thread:
opt waitmsg 1
int w1=ShowDialog nonmodal
int w2=ShowDialog nonmodal
rep
,if(!IsWindow(w1) and !IsWindow(w2)) break
,code
,3
Posts: 1,271
Threads: 399
Joined: Mar 2003
Gintaras Wrote: Better run everything in single thread:
run it where ?
Posts: 12,147
Threads: 143
Joined: Dec 2002
when you use mac, 3 or 4 threads are created
when you use code like in the last example, all code (both dialogs and the repeating code) runs in single thread
Posts: 1,271
Threads: 399
Joined: Mar 2003
this doen't work.
2 dialog only opens when first dialog has closed.
TSK_Main
opt waitmsg 1
int w1=ShowDialog ("TSK_Dialog1" &TSK_Dialog1 )
int w2=ShowDialog ("TSK_Dialog2" &TSK_Dialog2 )
rep
, if (!IsWindow (w1) and !IsWindow (w2)) break
, out "taskbars"
, 3
;mac "TSK_functions"
;mac "TSK_open1"
;mac "TSK_open2"
Posts: 12,147
Threads: 143
Joined: Dec 2002
Dialogs must be nonmodal. Flag 1.
Posts: 1,271
Threads: 399
Joined: Mar 2003
that works nice.
why does out count1+1 not work ?
TSK_Main
out
int count1
opt waitmsg 1
int w1=ShowDialog ("TSK_Dialog1" &TSK_Dialog1 0 0 1)
int w2=ShowDialog ("TSK_Dialog2" &TSK_Dialog2 0 0 1)
rep
, if (!IsWindow (w1) and !IsWindow (w2)) break
, ;count1+1
, out count1+1
, 3
Posts: 12,147
Threads: 143
Joined: Dec 2002
Should work. Where it stops? At IsWindow line?
Posts: 1,271
Threads: 399
Joined: Mar 2003
count1 is always 1 when using out count1+1.
this works:
Posts: 12,147
Threads: 143
Joined: Dec 2002
It isnt 1. It is 2, 3, ...
out
int count1
rep
, count1+1
, out count1+1
, 3