Salut
Comment peut connaitre la taille et la position de la taksbar de windows ?
thx ++
Salut
Comment peut connaitre la taille et la position de la taksbar de windows ?
thx ++
Via les API Windows peut-être ?
Thomas LEBRUN: MCAD.NET, MCTS (Win et Web), MCPD(Win et Web) & Microsoft MVP Client Application Development
WPF par la pratique, mon livre sur WPF ! (également disponible ici ou là)
A la découverte de .NET
Utilise GetWindowRect avec comme handle la valeur de retour de
( avec des P/Invoke ... )
Code : Sélectionner tout - Visualiser dans une fenêtre à part FindWindow("Shell_TrayWnd", NULL);
De la vallée du vent ...
Distribution d'applications .NET avec DreamShield
DreamShield, Le site, forum, blog, wiki & Jeux
Mon blog, Cours et tutoriels pour apprendre C#, forum C#, Offres d’emploi développeur C#
Merci ...
Cad : avec des P/Invoke ???
Alala
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 [Serializable, StructLayout(LayoutKind.Sequential)] public struct RECT { public int Left; public int Top; public int Right; public int Bottom; public RECT(int left_, int top_, int right_, int bottom_) { Left = left_; Top = top_; Right = right_; Bottom = bottom_; } public int Height { get { return Bottom - Top; } } public int Width { get { return Right - Left; } } public Size Size { get { return new Size(Width, Height); } } public Point Location { get { return new Point(Left, Top); } } // Handy method for converting to a System.Drawing.Rectangle public Rectangle ToRectangle() { return Rectangle.FromLTRB(Left, Top, Right, Bottom); } public static RECT FromRectangle(Rectangle rectangle) { return new RECT(rectangle.Left, rectangle.Top, rectangle.Right, rectangle.Bottom); } public override int GetHashCode() { return Left ^ ((Top << 13) | (Top >> 0x13)) ^ ((Width << 0x1a) | (Width >> 6)) ^ ((Height << 7) | (Height >> 0x19)); } #region Operator overloads public static implicit operator Rectangle(RECT rect) { return rect.ToRectangle(); } public static implicit operator RECT(Rectangle rect) { return FromRectangle(rect); } #endregion } [DllImport("user32.dll")] static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); Rectangle GetTaskBarCoords() { IntPtr shell = FindWindow("Shell_TrayWnd", ""); RECT rect; GetWindowRect(shell, out rect); return new Rectangle(rect.Left, rect.Top, rect.Width, rect.Height); }
De la vallée du vent ...
Distribution d'applications .NET avec DreamShield
DreamShield, Le site, forum, blog, wiki & Jeux
Mon blog, Cours et tutoriels pour apprendre C#, forum C#, Offres d’emploi développeur C#
Vous avez un bloqueur de publicités installé.
Le Club Developpez.com n'affiche que des publicités IT, discrètes et non intrusives.
Afin que nous puissions continuer à vous fournir gratuitement du contenu de qualité, merci de nous soutenir en désactivant votre bloqueur de publicités sur Developpez.com.
Partager