Bonjour tlm, j'ai esseyer de faire pour la première fois une fenêtre windows et j'ai un problème à la compilation et 3 warning, et je sais pas comment résoudre le problème:

Voici le fichier d'erreur que je reçoi pas le compilateur borland c++:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
C:\Documents and Settings\greg\Mes documents\greg\c++\prog win\win.cpp:
Warning W8004 C:\Documents and Settings\greg\Mes documents\greg\c++\prog win\win.cpp 20: 'PaintDC' is assigned a value that is never used in function __stdcall WndProc(HWND__ *,unsigned int,unsigned int,long)
Warning W8057 C:\Documents and Settings\greg\Mes documents\greg\c++\prog win\win.cpp 57: Parameter 'hPrevInst' is never used in function __stdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char *,int)
Warning W8057 C:\Documents and Settings\greg\Mes documents\greg\c++\prog win\win.cpp 57: Parameter 'lpszCmpParam' is never used in function __stdcall WinMain(HINSTANCE__ *,HINSTANCE__ *,char *,int)
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external '_main' referenced from C:\BORLAND\BCC55\LIB\C0X32.OBJ
Et voici la source de ma fenetre windows: (désoler pour la grandeur du code)

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
#include "windows.h"
 
LRESULT CALLBACK WndProc( HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam ) 
{
    switch(message) 
    { 
        case WM_KEYDOWN : 
             PostQuitMessage(0);
             break;
 
        case WM_DESTROY : 
             PostQuitMessage(0); // ici, on intercepte le message de destruction
             break;
 
        case WM_PAINT : // dessin de la zone client de l'application
        {
            PAINTSTRUCT PaintStruct; 
            HDC PaintDC=BeginPaint( hwnd, &PaintStruct ); 
            EndPaint( hwnd, &PaintStruct );
        }
        break;
    }
    return DefWindowProc( hwnd, message, wParam, lParam );
}
 
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrevInst,LPSTR lpszCmpParam,int nCmdShow) 
{
    WNDCLASS W; // structure de classe de fenêtre
    HWND hwnd;
    LPSTR Name = "Exemple d'Application";
    MSG msg;
 
    // remplissage de la structure de classe    
    memset( &W, 0, sizeof(WNDCLASS) );
    W.style = CS_HREDRAW | CS_VREDRAW;
    W.hInstance = hInst;
    W.lpszClassName = Name;
    W.hbrBackground =(HBRUSH) COLOR_WINDOW;
    W.lpfnWndProc = WndProc; // lien vers la procédure de fenêtre
    RegisterClass( &W ); // enregistrement dans Windows de la structure
 
    // Création de la fenêtre avec toutes les options nécessaires
    hwnd = CreateWindowEx( 0, Name, Name, WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, 0, 0, 300, 300, 
		NULL, NULL, hInst, NULL ); 
 
    // Affichage de la fenêtre
    ShowWindow( hwnd, nCmdShow ); 
    UpdateWindow( hwnd );
 
    // Boucle d'écoute des messages
    while( GetMessage( &msg, NULL, 0, 0) ) 
    { 
        TranslateMessage( &msg ); 
        DispatchMessage( &msg );
    }
    return msg.wParam; 
}
Merci d'avance...