Probleme applic windows simple

cs_zzzzzz Messages postés 408 Date d'inscription lundi 16 décembre 2002 Statut Membre Dernière intervention 18 décembre 2012 - 2 mars 2003 à 15:47
cs_Beuss Messages postés 100 Date d'inscription samedi 27 juillet 2002 Statut Membre Dernière intervention 11 juin 2003 - 2 mars 2003 à 19:18
#include <windows.h>
#include "resource.h"

HWND handleee;
HINSTANCE hinstanceee;
const char ClasseWindows[] = "NomClasseWindows";

LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);

int WINAPI Winmain(HINSTANCE hintanceee, HINSTANCE hinstancePRECEDENTE, LPSTR CmdLine, int CmdShow) {

MSG message;
WNDCLASSEX w;

HICON iconnn;
HCURSOR cursorrr;

iconnn = LoadIcon(hinstanceee,"IDI_ICON1");
cursorrr = LoadCursor(hinstanceee,"IDI_CURSOR1");

w.cbSize = sizeof(WNDCLASSEX);
w.cbClsExtra = 0;
w.cbWndExtra = 0;
w.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH);
w.hCursor = (NULL,cursorrr);
w.hIcon = (NULL,iconnn);
w.hIconSm = (NULL,iconnn);
w.hInstance = hinstanceee;
w.lpfnWndProc = WindowProcedure;
w.lpszClassName = ClasseWindows;
w.lpszMenuName = NULL;
w.style = CS_DBLCLKS;

if (!RegisterClassEx(&w))
return 0;

handleee = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, ClasseWindows, "Ma première fenêtre!!!",\
WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, 640, 480, HWND_DESKTOP, NULL, hinstanceee,\
NULL);

ShowWindow(handleee,SW_SHOW);
UpdateWindow(handleee);

while (GetMessage(&message, NULL, 0, 0))
{
TranslateMessage(&message);
DispatchMessage(&message);
}
return message.wParam;
}

LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT msg, WPARAM Wparam, LPARAM Iparam)
{
switch(msg) {
case WM_CREATE:
MessageBox(hwnd, "La fenêtre est créée!!!", "Infos", MB_OK|MB_ICONINFORMATION);
break;
case WM_DESTROY:
DestroyWindow(hwnd);
break;
case WM_CLOSE:
PostQuitMessage(0);
break;
default:
return DefWindowProc(hwnd, msg, Wparam, Iparam); /* Ne pas effacer */
break;
}
}

//////////////////////////////////////////////////////////

/*
voili voilou j'y ai compiler sous visual c++ 6 et sa me donne sa quand je compile
Compiling resources...
Compiling...
code.cpp
d:\documents and settings\admin\bureau\lalolilu\code.cpp(68) : warning C4715: 'WindowProcedure' : not all control paths return a value
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/lalolilu.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

lalolilu.exe - 2 error(s), 1 warning(s)

je suis sur que j'ai creer une applic windows vous pouvez pas m'aider c ma premier applic window siouplé?
*/

1 réponse

cs_Beuss Messages postés 100 Date d'inscription samedi 27 juillet 2002 Statut Membre Dernière intervention 11 juin 2003
2 mars 2003 à 19:18
Remplace Winmain par WinMain
0
Rejoignez-nous