Voila le code sur lequel je me base :
#include <windows.h>
HINSTANCE hInstance;
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam);
int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance,
LPSTR lpszArgument, int nFunsterStil)
{
HWND hWnd;
MSG messages;
WNDCLASSEX wincl;
RECT Client;
UNREFERENCED_PARAMETER (hPrevInstance);
UNREFERENCED_PARAMETER (lpszArgument);
hInstance = hThisInstance;
// Infos importantes
wincl.hInstance = hInstance;
wincl.lpszClassName = "Classe principale";
wincl.lpfnWndProc = WndProc;
wincl.style = 0;
wincl.cbSize = sizeof (WNDCLASSEX);
// Icones et curseurs par défaut
wincl.hIcon = LoadIcon (NULL, IDI_APPLICATION);
wincl.hIconSm = LoadIcon (NULL, IDI_APPLICATION);
wincl.hCursor = LoadCursor (NULL, IDC_ARROW);
wincl.lpszMenuName = NULL;
wincl.cbClsExtra = 0;
wincl.cbWndExtra = 0;
wincl.hbrBackground = GetStockObject (BLACK_BRUSH);
if (!RegisterClassEx (&wincl)) {
return EXIT_FAILURE;}
Client.left = 0;
Client.top = 0;
Client.right = 775;
Client.bottom = 575;
AdjustWindowRectEx (&Client, WS_OVERLAPPEDWINDOW, TRUE, 0);
hWnd = CreateWindowEx (
0,
"Classe principale",
"Fenêtre",
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
Client.right - Client.left, Client.bottom - Client.top,
NULL, NULL, hInstance, NULL);
if (!hWnd) {
return EXIT_FAILURE;}
ShowWindow(hWnd, nFunsterStil);
UpdateWindow(hWnd);
while (GetMessage (&messages, NULL, 0, 0))
{
TranslateMessage(&messages);
DispatchMessage(&messages);
}
return messages.wParam;
}
LRESULT CALLBACK WndProc (HWND hWnd, UINT message, WPARAM wParam,
LPARAM lParam)
{
HDC hDC;
PAINTSTRUCT ps;
switch (message)
{
case WM_DESTROY:
PostQuitMessage (0);
return TRUE;
case WM_PAINT:
// Affiche le bitmap.
hDC = BeginPaint (hWnd, &ps);
Sleep (20);
EndPaint (hWnd, &ps);
return TRUE;
default:
return DefWindowProc (hWnd, message, wParam, lParam);
}
}
ça a l'air d'etre un comportement normal.
Si tu fais la meme chose avec l'explorateur par exemple, le comportement
est le meme..
Mais c'est vrai ! Et cet fenêtre là n'ont pas de background en plus...
Ooups.vraiment désolé de poster cette question, je devrai toujours
essayer sur des fenêtre "pro" avant de trouver que c'est anormal...