Bonjour à tous

Je viens de creer mes premiers boutons dans ma premiere fenetre, et deja la joie m'a extorqué un petit cri de bonheur, qui s'est subreptissement echappé de ma bouche, sans crier gare

Grace au super TUTO de MELEM, j'ai compris noir de choses

Seulement voila...le bonheur viens de s'arretter a la premiere fonction que je voulais creer

J'ai voulu essayer d'exporter la creation de fenetre et le BEEP dans chacun une procedure pour voir comment manupuler les procedures

Et j'obtiens quand meme un exe, mais je n'arrive pas a me débarasser du message d'erreur avec PELLES C

Mais le plus fou c'est que avec VC6++ j'ai pas d'erreur
Quelqu'un sait pourquoi les deux compilateurs ne reagissent pas pareil ??

Building D:\Reception\FenetreEtBouton\output\Fenetre.obj.
D:\Reception\FenetreEtBouton\Fenetre.c(82): warning #2027: Missing prototype for 'Bip'.
Building D:\Reception\FenetreEtBouton\FenetreEtBouton.exe.
Done.
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#include <windows.h>
 
LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static HINSTANCE hInstance;
 
    switch (message)
    {
    case WM_CREATE:
 
        hInstance = ((LPCREATESTRUCT)lParam)->hInstance;
        CreateWindow("BUTTON", "OK", WS_CHILD | WS_VISIBLE, 0, 0, 100,24, hwnd, (HMENU)1, hInstance, NULL);
 
        break;
 
    case WM_COMMAND:
        /***************************************************\
        * LOWORD(wParam) = ID du contrôle ou du menu        *
        * HIWORD(wParam) = Raison du message (notification) *
        \***************************************************/
 
        switch(LOWORD(wParam))
        {
 
        case 1:
 
            switch(HIWORD(wParam))
            {
 
            case BN_CLICKED:
                Beep(1000, 100);
                break;
 
            default:
                break;
            }
 
            break;
 
        case 2:
 
            switch(HIWORD(wParam))
            {
 
            case BN_CLICKED:
 
                Beep(100, 100);
                break;
 
            default:
 
                break;
 
            }
 
            break; 
 
        default:
 
            break;
 
        }
 
        break; /* case WM_COMMAND */
 
    case WM_DESTROY:
 
        PostQuitMessage(0);
        break;
 
    default:
 
        return DefWindowProc(hwnd, message, wParam, lParam);
 
    }
 
    return 0;
 
}
 
void Bip(/*paramètres ou non*/)
{
 Beep(100, 100);
}
 
void Principal(HINSTANCE hInstance, int nCmdShow)
{
 
    HWND hWnd;
 
    hWnd = CreateWindow("Classe 1", "Notre première fenêtre", WS_OVERLAPPEDWINDOW,100, 100, 600, 300, NULL,NULL,hInstance,NULL);
    CreateWindow("BUTTON", "OK", WS_CHILD | WS_VISIBLE, 100,100, 100,24, hWnd, (HMENU)1, hInstance, NULL);
    CreateWindow("BUTTON", "OK", WS_CHILD | WS_VISIBLE, 200,200, 100,24, hWnd, (HMENU)2, hInstance, NULL);
    ShowWindow(hWnd, nCmdShow);
    Bip();
 
}
 
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
 
    MSG msg;
 
    WNDCLASS wc;
    wc.cbClsExtra     = 0;
    wc.cbWndExtra     = 0;
    wc.hbrBackground  = (HBRUSH)(COLOR_WINDOW + 1);
    wc.hCursor        = LoadCursor(NULL, IDC_ARROW);
    wc.hIcon          = LoadIcon(NULL, IDI_APPLICATION);
    wc.hInstance      = hInstance;
    wc.lpfnWndProc    = WndProc;
    wc.lpszClassName  = "Classe 1";
    wc.lpszMenuName   = NULL;
    wc.style          = CS_HREDRAW | CS_VREDRAW;
 
    RegisterClass(&wc);
 
    Principal(hInstance, nCmdShow);
 
    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
 
    return (int)msg.wParam;
}
Merci de votre aide