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
   |  
// Variables globales :
HINSTANCE hInst;	// instance actuelle
 
//Main windows principale
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
.
.
.
 	case ID_G_SOLUTION_PAS:
        HWND   sol;	
        sol = CreateWindow(szWindowClass, "SOLUTION", WS_OVERLAPPEDWINDOW,CW_USEDEFAULT, 0, CW_USEDEFAULT, 0,hWnd, NULL,hInst, NULL);
 
        ShowWindow (sol,SW_SHOW) ;		// affiche la fenêtre à l'écran
        UpdateWindow (sol) ;
.
.
.
}
 
 
//Deuxieme Fenetre windows pour afficher la solution
LRESULT CALLBACK Soluce (HWND sol, UINT message, WPARAM wParam, LPARAM lParam)
{ 
    /////POUR LE DESSIN
	PAINTSTRUCT ps;// attributs relatif a l'affichage de la fenetre
	HDC hdc;// contexte de peripherique
 
    switch (message)
     {
 
       case WM_DESTROY:	// message de fermeture du programme
          PostQuitMessage (0) ;
          return 0 ;
 
       case WM_KEYDOWN:		// tape d'une touche détecter
		 switch(wParam)
		 {
			case WM_KEYDOWN:
                //test	
				MessageBox (NULL,"Flèche gauche","Information", MB_ICONINFORMATION) ;
				break;
			case WM_PAINT:	
            hdc = BeginPaint(sol, &ps);
            SetBkMode(hdc, TRANSPARENT);  
	        EndPaint(sol, &ps);
				break;
			default:
				break;
		 }
		 break;
     }
     return DefWindowProc (sol, message, wParam, lParam) ;
} | 
Partager