Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
2 taskbars
#1
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
.qml   2 taskbars.qml (Size: 6.45 KB / Downloads: 454)
pi
#2
why doesn't qm show up on one of my taskbars ?


Code:
Copy      Help
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 -

Code:
Copy      Help
tb1=
;;/hook _taskbar_hook /ini taskbar1.ini
;Close :clo win(mouse) *close.ico
;-

how to use newline in a multiline variable ?
pi
#3
Add one more line containing just single space character.
#4
do you know a way to show the windows start menu at mouse position ?
pi
#5
no, only this:

Code:
Copy      Help
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
#6
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.

Code:
Copy      Help
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.
pi
#7
Make sure it is like

/ini "$my qm$\toolbars.ini"

, but not

/ini $my qm$\toolbars.ini

and not

/ini "toolbars.ini"
#8
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.
pi
#9
In hook function:

Code:
Copy      Help
,case WM_INITDIALOG
,SetWinStyle id(9999 hWnd) TBSTYLE_WRAPABLE 2
#10
Or use updated TB_AdjustSize with flag 1.

Auto toolbar height
#11
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 ?
pi
#12
This is how to detect classic start menu

Code:
Copy      Help
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
#13
the user picture window does not exist on classic menu, and hid throws error

_taskbars_func
Code:
Copy      Help
;/
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
,,
#14
thanks. uploaded v0.04

how to avoid flicker when adding taskbars_main to init2 ?

Code:
Copy      Help
tim 5 taskbars_main
pi
#15
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.
#16
so the only alternative i see is to use dialogs instead.
pi
#17
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.
#18
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.
pi
#19
mac "functionthatopens1dialog"
mac "functionthatopens1dialog"

Dialogs will run in separate threads. Do you need them to run in same thread?
#20
Gintaras Wrote:Do you need them to run in same thread?

no, thats fine.

my main function is now:
TSK_Main
Code:
Copy      Help
mac "TSK_functions"
mac "TSK_open1"
mac "TSK_open2"


how do is start TSK_functions in an own thread with 3s repeat ?

TSK_functions
Code:
Copy      Help
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
.qml   Taskbars.qml (Size: 5.12 KB / Downloads: 735)
pi
#21
rep
,code
,3
#22
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
#23
Gintaras Wrote:Better run everything in single thread:

run it where ?
pi
#24
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
#25
this doen't work.
2 dialog only opens when first dialog has closed.

TSK_Main
Code:
Copy      Help
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"
pi
#26
Dialogs must be nonmodal. Flag 1.
#27
that works nice.
Code:
Copy      Help
why does out count1+1 not work ?


TSK_Main
Code:
Copy      Help
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
pi
#28
Should work. Where it stops? At IsWindow line?
#29
count1 is always 1 when using out count1+1.

this works:
Code:
Copy      Help
,count1+1
,out count1
pi
#30
It isnt 1. It is 2, 3, ...

Code:
Copy      Help
out
int count1
rep
,count1+1
,out count1+1
,3


Forum Jump:


Users browsing this thread: 1 Guest(s)