mar. 26 décembre 2017, 20h51
ybenam
Algérie
atoutfox.public.association
Re: J'ai enfin réglé le probleme du Systray avec la barre de tache
J'ai testé le systray avec ton code sur les positions du "taskbar :bottom,left,top et left" et avec des épaisseurs différentes
j'ai windows10 fall creator (1709).
regarde cette photo:
https://www.cjoint.com/c/GLAjeKatSQMle problème rencontré se situe quand le taskbar est en position right,les 3 autres positions marchent sans problème.
fouillant dans le code de la classe systray.vcx, j'ai vu que la position left est un peu approximative et c'est la proprité menuoffsetfromright qui est concernée (extrait):
*-- Essentially the width of your menu in pixels. This is an offset used when the TaskBar is docked on the right, to prevent the menu from being
*--drawn underneath the taskbar.
menuoffsetfromright = 200
et
* Now position form near mouse, but adjust for taskbar.
DO CASE
CASE m.lnTaskBarLocation = 1 && Left
loTempForm.top = m.lnYCoord
loTempForm.Left = m.lnTaskBarRight + 7
CASE m.lnTaskBarLocation = 2 && Top
* Ideally would determine height of titlebar, and subtract that.
* But this is sufficient.
loTempForm.top = m.lnTaskBarBottom - 8
loTempForm.Left = m.lnXCoord
CASE m.lnTaskBarLocation = 3 && Right
loTempForm.top = m.lnYCoord
*loTempForm.left= m.lnXCoord -2*this.MenuOffsetFromRight
loTempForm.Left = m.lnTaskBarLeft - this.MenuOffsetFromRight && Roughly the width of a typical menu.
OTHERWISE && Bottom, or coding error.
* Just place the window near the mouse.
loTempForm.top = m.lnYCoord
loTempForm.Left = m.lnXCoord
ENDCASE
* Window must be the foreground window when shortcut menu displayed. Otherwise,
* clicking in another window won't release the shortcut menu.
loTempForm.Show
THIS.SetForegroundWindow(loTempForm.hWnd)
ici et dans le cas 3 cad m.lnTaskBarLocation = 3 && Right
l'épaisseur du menu contextuel a été approximée et non calculée exactement par e() auteur(s) de la classe (200px)
si quelqu'un peut calculer le "width" d'un menu contextuel cela peur être réglé dans le code et fera diqparaître ce bug.
Actuellement le taskbar est expansible par l'utilisateur et peut aller de 1cm à plusieurs cms.
je pense qu'à l'époque de windows XP le taskbar était de dimensions fixes (à confirmer).
Permalink : http://www.atoutfox.org/nntp.asp?ID=0000018725