IdentifiantMot de passe
Loading...
Mot de passe oubli� ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les r�ponses en temps r�el, voter pour les messages, poser vos propres questions et recevoir la newsletter

MFC Discussion :

comment changer le handle de fen�tre


Sujet :

MFC

Vue hybride

Message pr�c�dent Message pr�c�dent   Message suivant Message suivant
  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut comment changer le handle de fen�tre
    g une classe CPhoto avec un objet fen�tre client, en viedolive sur 1/4 de ma fenetre parent. je souhaite afficher 4 fenetres sur tt l'ecran dont 3 fig�es et une qui reste en videolive. Comment charger une nouvelle fenetre � partir de la premiere
    fenetre client:
    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
     
    bool CPhoto::Create(HINSTANCE hInst, HWND hParent)
    {
    if (hWnd != NULL) return false;
     
    hParentWnd = hParent;
    hWnd = CreateWindow("Photo",
    					"",
    					WS_CHILD | WS_BORDER,
    					0,
    					0,
    					360,
    					291,
    					hParentWnd,
    					NULL,
    					hInst,
    					NULL);
    if (hWnd != NULL) ShowWindow(hWnd, SW_SHOW);
    return (hWnd != NULL);
    }
     
     
     
    CPhoto::~CPhoto()
    {
    Destroy();
    }
     
     
     
    void CPhoto::Destroy(void)
    {
    if (hWnd == NULL) return ;
    DestroyWindow(hWnd);
    }
    fenetre parent:
    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
     
    	wc.style = 0;
    	wc.lpfnWndProc = WinPhotoProc;
    	wc.cbClsExtra = 0;
    	wc.cbWndExtra = 0;
    	wc.hInstance = hIns;
    	wc.hIcon = NULL;
    	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    	wc.lpszMenuName = "";
    	wc.lpszClassName = "Photo";
     
    	if (!RegisterClass(&wc))
    		{
    		//Message("RegisterClass(\"WinUra\") impossible\n");
    		return 0;
    		}
     
        hInst = hIns;
     
        hWnd = CreateWindow("WinUraWC",
    						"WinUra",
    						WS_OVERLAPPEDWINDOW,
    						CW_USEDEFAULT,
    						CW_USEDEFAULT,
    						CW_USEDEFAULT,
    						CW_USEDEFAULT,
    						NULL,
    						NULL,
    						hIns,
    						NULL);
     
        ShowWindow(hWnd, nCmdShow);
        UpdateWindow(hWnd);
    	if (!Photo0.Create(hIns, hWnd)) return 0;
     
    	if (!Init(Photo0.hWnd))
    		return 0;
    	ForceClientAreaSize(hWnd, 720, 578);
    @+

  2. #2
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    salut,

    une fois ta deuxieme fenetre cr��e, il faut l'afficher, comme la premiere ...
    avec
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    ShowWindow(handleCreeParCPhoto, nCmdShow); 
        UpdateWindow(handleCreeParCPhoto);

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut comment changer de handle de fenetre
    ok mais comment positionner les 3 autres fenetres � partir de la 1�re cad le but est que lorsque je fige la 1�re, la 2�me s'affiche ensuite se fige etc...
    1ere fenetre
    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
     
    bool CPhoto::Create(HINSTANCE hInst, HWND hParent)
    {
    if (hWnd != NULL) return false;
     
    hParentWnd = hParent;
    hWnd = CreateWindow("Photo",
    					"",
    					WS_CHILD | WS_BORDER,
    					0,  ---> modifier?
    					0,  ---> modifier?
    					360,
    					291,
    					hParentWnd,
    					NULL,
    					hInst,
    					NULL);
    if (hWnd != NULL) ShowWindow(hWnd, SW_SHOW);
    return (hWnd != NULL);
    }

  4. #4
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    lorsque tu figes la fenetre ? je ne comprends pas, comment figes-tu ?

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut comment changer de handle de fenetre
    Je dois � partir d'une source video afficher 4 photos sur mon ecran
    cad l'acquisition video s'initialise sur 1/4 de la wnd parent. Je vais en cliquant sur la fenetre client en videolive figer l'image en stoppant la capture, changer de wnd et red�marrer la capture dans la 2�me wnd ...
    d'ici je stoppe le monitoring et doit red�marrer sur une 2�me wnd
    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
     
    CPhoto::~CPhoto()
    {
    Destroy();
    }
     
     
     
    void CPhoto::Destroy(void)
    {
    if (hWnd == NULL) return ;
    DestroyWindow(hWnd);
    }
     
     
    LRESULT CALLBACK WinPhotoProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
    { 
       switch( message ) 
       { 
          case WM_COMMAND: 
             // ... 
             break; 
          case WM_LBUTTONDOWN: 
             trace("Terminaison\n"); 
             UranieStopMonitoring(hUranie, hWnd); ----> je fige la photo et il faut starter  dans une autre wnd
             return 0; 
       } 
       return DefWindowProc( hWnd, message, wParam, lParam ); 
    }

  6. #6
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    et bien c'est � ce moment que tu fais les createwindow et les showwindow, et si tu as besoin de les repositionner, tu peux utiliser SetWindowPos

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut comment changer de handle de fenetre
    cad (CreateWindow+ShowWindow+SetPosWindow) * 3 ds ce cas � partir
    du click sur la 1�re fen�tre.
    le ShowWindow de la 1�re(Photo0) se fait dans le fenetre parent?
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
     
    ShowWindow(hWnd, nCmdShow);
        UpdateWindow(hWnd);
    	if (!Photo0.Create(hIns, hWnd)) return 0;
     
    	if (!Init(Photo0.hWnd))
     
    		return 0;

  8. #8
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    le showWindow se fait au moment o� tu veux afficher la fenetre (la cr�ation peut avoir �t� faite avant, il faut juste le handle de la fenetre).

    Donc, si tu veux qu'une deuxieme fenetre s'affiche au moment du click sur la souris, tu fais le showWindow dans le case WM_LBUTTONDOWN

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut
    newbie je suis, le handle de la 2�me fen�tre du CreateWindow n'est pas hWnd mais par ex hWndPhoto1
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
     
    hParentWnd = hParent; ---> à changer?
    hWndPhoto1 = CreateWindow("Photo",
    					"",
    					WS_CHILD | WS_BORDER,
    					0,
    					0,
    					360,
    					291,
    					hParentWnd,---> à changer?
    					NULL,
    					hInst,
    					NULL);
    [/code]

  10. #10
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    je ne sais pas comment est fait ta classe CPhoto, mais elle semble disposer d'un attribut hWnd.

    Si c'est le cas, je ferais
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    CPhoto fenetrePhoto1;
    fenetrePhoto1.Create(...); // fait le createWindow
    ShowWindow(fenetrePhoto1.hWnd); // handle associé à la premiere fenetre
     
    CPhoto fenetrePhoto2;
    fenetrePhoto2.Create(...);
    ShowWindow(fenetrePhoto2.hWnd); // affiche la deuxieme fenetre
    Il faut bien comprendre qu'� chaque fenetre est associ�e un handle de fenetre (ce handle est retourn� par la fonction CreateWindow)

  11. #11
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut
    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
     
    	wc.style = 0;
    	wc.lpfnWndProc = WinPhotoProc;
    	wc.cbClsExtra = 0;
    	wc.cbWndExtra = 0;
    	wc.hInstance = hIns;
    	wc.hIcon = NULL;
    	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    	wc.lpszMenuName = "";
    	wc.lpszClassName = "Photo";
     
    	if (!RegisterClass(&wc))
    		{
    		//Message("RegisterClass(\"WinUra\") impossible\n");
    		return 0;
    		}

  12. #12
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    il faut �videment une classe (dans le sens RegisterClass) par fenetre, pour avoir le lpfnWndProc associ� � la bonne fenetre afin de diff�rencier les messages qui sont pour les diff�rentes fenetres et d'avoir une callback par fenetre.
    Ou alors utiliser SetWindowLong pour changer la proc�dure de callback, mais cela me semble plus compliqu� et plus fastidieux que de cr�er une classe diff�rente par fenetre

  13. #13
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut
    la question est de savoir comment cr�er les fenetres 2/3/4(Ds la classe CPhoto)

    J'ai une classe CPhoto et la fenetre Photo0 s'affiche depuis WinMain
    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
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
     
    int APIENTRY WinMain(HINSTANCE hIns, HINSTANCE hPrevIns, LPSTR lpCmdLine, int nCmdShow)
    //	***********************************************************************************
    {
        WNDCLASS	wc;
        HWND	hWnd;
        MSG 	msg;
     
        trace("WinMain(hIns=0x%x, hPrevIns=0x%x, lpCmdLine=\"%s\", nCmdShow=0x%x)\n", hIns, hPrevIns, lpCmdLine, nCmdShow);
     
        wc.style = 0;
        wc.lpfnWndProc = WinUraWinProc;
        wc.cbClsExtra = 0;
        wc.cbWndExtra = 0;
        wc.hInstance = hIns;
        wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
        wc.hCursor = LoadCursor(NULL, IDC_ARROW);
        wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
        wc.lpszMenuName = "WinUraMenu";
        wc.lpszClassName = "WinUraWC";
     
        if (!RegisterClass(&wc))
        {
    		Message("RegisterClass(\"WinUra\") impossible\n");
    		return 0;
        }
     
     
    	wc.style = 0;
    	wc.lpfnWndProc = WinPhotoProc;
    	wc.cbClsExtra = 0;
    	wc.cbWndExtra = 0;
    	wc.hInstance = hIns;
    	wc.hIcon = NULL;
    	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    	wc.lpszMenuName = "";
    	wc.lpszClassName = "Photo";
     
    	if (!RegisterClass(&wc))
    		{
    		//Message("RegisterClass(\"WinUra\") impossible\n");
    		return 0;
    		}
     
        hInst = hIns;
     
        hWnd = CreateWindow("WinUraWC",
    						"WinUra",
    						WS_OVERLAPPEDWINDOW,
    						CW_USEDEFAULT,
    						CW_USEDEFAULT,
    						CW_USEDEFAULT,
    						CW_USEDEFAULT,
    						NULL,
    						NULL,
    						hIns,
    						NULL);
     
        ShowWindow(hWnd, nCmdShow);
        UpdateWindow(hWnd);
    	if (!Photo0.Create(hIns, hWnd)) return 0;
     
    	if (!Init(Photo0.hWnd))
    		return 0;
    	ForceClientAreaSize(hWnd, 720, 578);
    	hAccel = LoadAccelerators(hInst, MAKEINTRESOURCE(IDC_WinUra));
    	SetTimer(hWnd, 0, 1000, NULL);
        while(GetMessage(&msg, NULL, 0, 0))
        {
    		if ((hAccel == NULL) || !TranslateAccelerator(hWnd, hAccel, &msg))
    		{
    			TranslateMessage(&msg);
    			DispatchMessage(&msg);
    		}
        }
        trace("Sortie de la boucle des messages\n");
    	Term(Photo0.hWnd);
        return msg.wParam;
    }

  14. #14
    Membre �prouv� Avatar de ken_le_videur
    Profil pro
    Inscrit en
    Juillet 2002
    Messages
    129
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juillet 2002
    Messages : 129
    Par d�faut
    Dans winmain:

    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    CPhoto Photo0;
    CPhoto Photo1;
    CPhoto Photo2;
    CPhoto Photo3;
     
    if (!Photo0.Create(hIns, hWnd)) return 0; 
    if (!Photo1.Create(hIns, hWnd)) return 0; 
    if (!Photo2.Create(hIns, hWnd)) return 0; 
    if (!Photo3.Create(hIns, hWnd)) return 0;
    En rajoutant a la rigueur un param�tre dans CPhoto:Create pour pr�ciser la position de la fen�tre.

  15. #15
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    sauf que j'imagine (il faudrait voir le code de la classe CPhoto) chaque fenetre cr��e comme ca sera associ�e � la meme callback, c'est � dire WinPhotoProc

  16. #16
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut
    Voici CPhoto
    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
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
     
    #include "stdafx.h"
    #include "WinUra.h"
    #include "Uranie.h"
     
     
     
    extern HANDLE hUranie;
    CPhoto Photo1;
     
    int CPhoto::nInst = 0;
     
    bool CPhoto::Create(HINSTANCE hInst, HWND hParent)
    {
    if (hWnd != NULL) return false;
     
    hParentWnd = hParent;
    hWnd = CreateWindow("Photo",
    					"",
    					WS_CHILD | WS_BORDER,
    					0,
    					0,
    					360,
    					291,
    					hParentWnd,
    					NULL,
    					hInst,
    					NULL);
    if (hWnd != NULL) ShowWindow(hWnd, SW_SHOW);
    return (hWnd != NULL);
    }
    /*hParentWnd = hParent; ce que j'ai ajouté
    Photo1.CreateWindow("Photo,
    					"",
    					WS_CHILD | WS_BORDER,
    					361,
    					280,
    					360,
    					291,
    					hParentWnd,
    					NULL,
    					hInst,
    					NULL);
     
    */
    CPhoto::~CPhoto()
    {
    Destroy();
    }
     
     
     
    void CPhoto::Destroy(void)
    {
    if (hWnd == NULL) return ;
    DestroyWindow(hWnd);
    }
     
     
    LRESULT CALLBACK WinPhotoProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
    { 
       switch( message ) 
       { 
          case WM_COMMAND: 
             // ... 
             break; 
          case WM_LBUTTONDOWN: 
             trace("Terminaison\n"); 
             UranieStopMonitoring(hUranie, hWnd); 
    		 return 0; 
    		ShowWindow(fenetrePhoto1.hWnd, nCmdShow); ce que j'ai ajouté
    		 UpdateWindow(hWnd);
    			if (!Photo1.Create(hIns, hWnd)) return 0;
    			if (!Init(Photo1.hWnd))	return 0
             */
       } 
       return DefWindowProc( hWnd, message, wParam, lParam ); 
    }
     
     
     
    CPhoto::CPhoto()
    {
    nInst++;
    hWnd=NULL; 
    }

  17. #17
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    dans ce que tu as ajout�, tu cr�es une autre fenetre mais qui est rattach�e � la meme classe "Photo", donc rattach�e � la meme callback. Il faut que tu enregistres une classe par fenetre et que tu fasses une callback par classe

  18. #18
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut
    autant de classes que de fen�tres la procedure WinPhotoProc est identique
    pour ttes les classes.
    Ce qui va changer est la position de chaque fenetre(int x, int y) ds le CreateWindow
    Ce qui va changer pour changer le handle de chaque fenetre dans
    le callback de chaque classe
    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
     
    LRESULT CALLBACK WinPhotoProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
    { 
       switch( message ) 
       { 
          case WM_COMMAND: 
             // ... 
             break; 
          case WM_LBUTTONDOWN: 
             trace("Terminaison\n"); 
             UranieStopMonitoring(hUranie, hWnd); 
             ShowWindow???????
    		 return 0; 
     
       } 
       return DefWindowProc( hWnd, message, wParam, lParam ); 
    }

  19. #19
    R�dacteur
    Avatar de nico-pyright(c)
    Profil pro
    Inscrit en
    Octobre 2003
    Messages
    6 414
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2003
    Messages : 6 414
    Par d�faut
    tu veux dire que pour les trois fenetres cr��es, le comportement va etre le meme ?


    comprenons nous bien, il y a
    la classe au sens c++ du terme, la classe CPhoto par ex
    la classe au sens "fenetre", c'est � dire utilis�e par RegisterClass

    Ce que je te dis, c'est que la classe fenetre "photo" d�finie ici
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     wc.style = 0; 
       wc.lpfnWndProc = WinPhotoProc; 
       wc.cbClsExtra = 0; 
       wc.cbWndExtra = 0; 
       wc.hInstance = hIns; 
       wc.hIcon = NULL; 
       wc.hCursor = LoadCursor(NULL, IDC_ARROW); 
       wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH); 
       wc.lpszMenuName = ""; 
       wc.lpszClassName = "Photo"; 
     
       if (!RegisterClass(&wc))
    s'appelle "Photo", car
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
       wc.lpszClassName = "Photo";
    et est g�r�e par la fonction callback WinPhotoProc, car
    Code : S�lectionner tout - Visualiser dans une fen�tre � part
       wc.lpfnWndProc = WinPhotoProc;
    donc, pour chaque CreateWindow("Photo,, la fenetre cr��e sera g�r�e par la fonction WinPhotoProc

  20. #20
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2005
    Messages
    31
    D�tails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2005
    Messages : 31
    Par d�faut
    msg re�u, autre chose comment dupliquer une classe et tous ses membres ?

Discussions similaires

  1. Comment changer l'apparence d'une fen�tre
    Par bandit boy dans le forum C++Builder
    R�ponses: 13
    Dernier message: 26/06/2011, 16h12
  2. R�ponses: 11
    Dernier message: 19/09/2007, 19h03
  3. R�ponses: 3
    Dernier message: 26/07/2007, 18h28

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo