Une petite routine sans aucune prétention pour connaitre la position de la TaskBar de Windows. Cela peu servir par exemple pour un fenêtre toast ect...
Code : Tout sélectionner
; +======================================================+
; | ROUTINE DE POSITION DE LA TASKBAR DE WINDOWS |
; +------------------------------------------------------+
; | COPYRIGHT(C)2007-2008, ALL RIGHT RESERVED KOAKDESIGN |
; +--------------+---------------------------------------+
; | Program type | PUREBASIC 4.51 |
; +--------------+---------------------------------------+
; | VER & REV | 0.0.1 |
; +--------------+---------------------------------------+
; | Program name | main.pb |
; +======================================================+
; +======================================================+
; | Original Version: 0.0.1 |
; +--------------+---------------------------------------+
; | Created by | GALLYHOMECORP |
; | Graphix by | |
; +--------------+---------------------------------------+
; | Comments: | |
; +--------------+ |
; | |
; | |
; | |
; +======================================================+
; +======================================================+
; | Système d'Exploitation |
; +--------------+---------------------------------------+
; | Window | Oui |
; | Linux | Non |
; | MacOS | Non |
; +======================================================+
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
#ABM_GETSTATE = 4
#ABM_GETTASKBARPOS = 5
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
Structure lNXY
width.l
height.l
EndStructure
Define tepLENData.lNXY
Define tepSVEData.RECT
Define tpeAPPData.APPBARDATA
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
SHAppBarMessage_(#ABM_GETTASKBARPOS, tpeAPPData)
SHAppBarMessage_(#ABM_GETSTATE, tpeAPPData)
tepSVEData\left = tpeAPPData\rc\Left
tepSVEData\right = tpeAPPData\rc\Right
tepSVEData\top = tpeAPPData\rc\Top
tepSVEData\bottom = tpeAPPData\rc\Bottom
tepLENData\width = tepSVEData\right - tepSVEData\left
tepLENData\height = tepSVEData\bottom - tepSVEData\top
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; ****************************************************************************
; +--------------------------------------------------------------------------+
; | |
; +--------------------------------------------------------------------------+
If tepSVEData\left < 1 And tepSVEData\top < 1 And (tepLENData\width > tepLENData\height)
Debug "TaskBAr en Haut"
EndIf
If tepSVEData\left < 1 And tepSVEData\top > 0 And (tepLENData\width > tepLENData\height)
Debug "TaskBar en bas"
EndIf
If tepSVEData\left < 1 And tepSVEData\top < 1 And (tepLENData\width < tepLENData\height)
Debug "TaskBar à Gauche"
EndIf
If tepSVEData\left > 1 And tepSVEData\top < 1 And (tepLENData\width < tepLENData\height)
Debug "TaskBar à Droite"
EndIf
GallyHC