Probleme avec AdjustWindowRect et GetClientRect
J'ai un petit soucis avec ces 2 fonctions. Je veux creer une fenetre avec une certaine taille (disons 100 x 100) pour la zone client. Voici mon code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
|
Rect rect;
HWND w;
rect.left = 0;
rect.top = 0;
rect.right = 100;
rect.bottom = 100;
if (!AdjustWindowRect(&rect, WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN, FALSE))
return NULL;
w = CreateWindow(ECORE_WIN32_WINDOW_CLASS, "",
WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN,
x, y,
rect.right - rect.left,
rect.bottom - rect.top,
NULL, NULL, _ecore_win32_instance, NULL);
if (!w)
return NULL;
if (GetClientRect(w, &rect))
printf ("taille %ld %ld\n", rect.right - rect.left, rect.bottom - rect.top); |
la taille affichee est non pas 100 x 100 mais 104 x 100.
Par contre, si je demande 320 x 200, la taille affichee est la meme que celle demandee.
Quelqu'un voit-il pourquoi ?
merci