Les Snippets

Connexion

Récupérer la hauteur de la barre des tâches

Niveau requis pour utiliser/comprendre cette source : 1 ( Débutant )
Créé le 11/02/2007 23:04:01 et initié par WhiteHippo [Liste]
Date de mise à jour : 16/02/2007 18:20:53
Vue : 7602
Catégorie(s) : API, Trucs & Astuces
Langages dispo pour ce code :
- Delphi 5
- Delphi 5
- Delphi 5
- Delphi 5
- C
- Voir tous les langages pour ce code snippet



Langage : Delphi 5
Date ajout : 16/02/2007
Posté par f0xi [Liste]
{**
  Variante de mon code precedent en utilisant pas l'objet TScreen mais
  la fonction GetWindowDesktop.
**}

function GetTaskBarInfos(var tbi : TTaskBarInfo) : boolean;
var TR : TRect;
    DR : TRect;
    DL,DT,DW,DH : integer;
begin
  with tbi do
  begin
    Handle := FindWindow('Shell_TrayWnd',''); { @User32.FindWindowA }
    result := Handle <> INVALID_HANDLE_VALUE;
    if result then
    begin
      result := GetWindowRect(Handle, TR); { @User32.GetWindowRect}
      if result then
      begin
        Left   := TR.Left;
        Top    := TR.Top;
        Width  := TR.Right - TR.Left;
        Height := TR.Bottom - TR.Top;
        GetWindowRect(GetDesktopWindow, DR); { @User32.GetDesktopWindow }
        DL     := DR.Left;
        DT     := DR.Top;
        DW     := DR.Right-DR.Left;
        DH     := DR.Bottom-DR.Top;
        if (Left = DL) and (Top = DT) and (Width = DW) and (Height < DH) then
           Position := TASKBAR_POSITION_TOP
        else
        if (Left = DL) and (Top > DT) and (Width = DW) and (Height < DH) then
           Position := TASKBAR_POSITION_BOTTOM
        else
        if (Left = DL) and (Top = DT) and (Width < DW) and (Height = DH) then
           Position := TASKBAR_POSITION_LEFT
        else
        if (Left > DL) and (Top = DT) and (Width < DW) and (Height = DH) then
           Position := TASKBAR_POSITION_RIGHT
        else
           Position := TASKBAR_POSITION_UNKNOW;
      end;
    end;
  end;
end;


Snippets en rapport avec : Barre, Tâches, Windows, Hauteur



Codes sources en rapport avec : Barre, Tâches, Windows, Hauteur

{C / C++ / C++.NET} MODIFIER LA HAUTEUR DE LA BARRE DE TACHES
problème: quelle que soit la hauteur de la barre de tache avant l'extinction de Windows XP, celle-...

{JAVA / J2EE} PLEIN ECRAN EN TENANT COMPTE DE LA BARRE DES TACHES
Apparement c'est une question récurente dans le forum alors voila un petit bout de code ;)...

{C / C++ / C++.NET} ICONE DANS LA BARRE DES TACHES AVEC MENU (VC++)
Illustration pour mettre et enlever une icone dans la barre de taches avec gestion d'un menu. J'ai ...

{Visual Basic, VB6, VB.NET, VB 2005} MASQUER LA BARRE DES TÂCHES WINDOWS
...

{Javascript / DHTML} AFFICHE DE 1 A PLEIN DE MESSAGES DANS LA BARRE DE STATUT DU VISITEUR
Comme son nom l'indique se petit bout de script affichera des messages qui défileront successivement...

{Delphi} BARRE DE PROGRESSION À LA CLEARLOOKS
Voici un composant basé sur la librairie Graphics32 qui permet d'être utilisé en tant que barre de p...

{Javascript / DHTML} CONFORTABLE AUTO DÉFILEMENT OU (SCROLL BAR) TOUT AUTOMATIQUE AVEC VITESSE LIBREMENT VARIABLE
Confortable auto défilement ou (scroll bar) tout automatique avec vitesse librement variable: c'est...

{Visual Basic, VB6, VB.NET, VB 2005} WIN++ OPTIONS AVANCÉES SUR LES FENETRES ET PROCESSUS WINDOWS (CPU LIMITER, CTRL ALT END, METTRE EN PAUSE UN PROCESSUS...)
Bonjour à tous, Voici un programme dont le but est le suivant : Rassembler toutes les petites so...

{Visual Basic, VB6, VB.NET, VB 2005} API WIN32 FACILE
petit exemple d'utilisation des api j'ai utilisé P/Invoke Interop Assistant pour les quelques fo...

{Visual Basic, VB6, VB.NET, VB 2005} AUTHENTIFICATION WINDOWS
Bonjour, suite à plusieurs post, je vous propose un bout de code permettant de mettre une forme e...