Google Groups Home
Help | Sign in
Effet désagréable lors du redimentionnement
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Michel  
View profile
 More options May 2, 4:58 pm
Newsgroups: fr.comp.os.ms-windows.programmation
From: Michel <mynameis_mic...@hotmail.fr>
Date: Fri, 2 May 2008 13:58:57 -0700 (PDT)
Local: Fri, May 2 2008 4:58 pm
Subject: Effet désagréable lors du redimentionnement
Bonjour.
Avec un programme standard utilisant l'API et dont l'affichage prend
un peu de temps, j'ai remarqué qu'on a un effet plutot moche lorsqu'on
redimentionne la fenêtre vers le haut ou vers la gauche : la fenêtre
est comme transparente du coté opposé pendant un intervalle très
court.
Cet effet est d'autant plus génant qu'il ne touche pas seulement
l'espace client, mais également la barre du haut.
Pourtant un background est utilisé, ce qui normalement réduit les
effet de transparence.
Comment faire pour l'éviter?

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);
        }


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
louis  
View profile
 More options May 2, 5:33 pm
Newsgroups: fr.comp.os.ms-windows.programmation
From: louis <lo...@ferk.com>
Date: Fri, 02 May 2008 23:33:30 +0200
Local: Fri, May 2 2008 5:33 pm
Subject: Re: Effet désagréable lors du redimentionnement

Michel wrote:
> Bonjour.
> Avec un programme standard utilisant l'API et dont l'affichage prend
> un peu de temps, j'ai remarqué qu'on a un effet plutot moche lorsqu'on
> redimentionne la fenêtre vers le haut ou vers la gauche : la fenêtre
> est comme transparente du coté opposé pendant un intervalle très
> court.
> Cet effet est d'autant plus génant qu'il ne touche pas seulement
> l'espace client, mais également la barre du haut.
> Pourtant un background est utilisé, ce qui normalement réduit les
> effet de transparence.
> Comment faire pour l'éviter?

ç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..

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michel  
View profile
 More options May 2, 6:12 pm
Newsgroups: fr.comp.os.ms-windows.programmation
From: Michel <mynameis_mic...@hotmail.fr>
Date: Fri, 2 May 2008 15:12:04 -0700 (PDT)
Local: Fri, May 2 2008 6:12 pm
Subject: Re: Effet désagréable lors du redimentionnement
On 2 mai, 23:33, louis <lo...@ferk.com> wrote:

> ç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...

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google