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
   | LRESULT CALLBACK MainWndProc(HWND, UINT, WPARAM, LPARAM);
 
int WINAPI WinMain(HINSTANCE Hinstance, HINSTANCE hPrevInstance,LPSTR lpCmdLine, int nCmdShow)
{
    HWND Hwnd;
    MSG msg;
    WNDCLASSEX WndClsEx;
 
    hinst = Hinstance;
 
    WndClsEx.hInstance      = Hinstance;
    WndClsEx.lpszClassName  = "MyWindows";
    WndClsEx.lpfnWndProc    = MainWndProc;
    WndClsEx.style          = CS_DBLCLKS;
    WndClsEx.cbSize         = sizeof (WNDCLASSEX);
    WndClsEx.hIcon          = LoadIcon(Hinstance,MAKEINTRESOURCE(1));
    WndClsEx.hIconSm        = LoadIcon(Hinstance,MAKEINTRESOURCE(1));
    WndClsEx.hCursor        = LoadCursor (NULL, IDC_ARROW);
    WndClsEx.lpszMenuName   = "MENUPRINCIPAL";
    WndClsEx.cbClsExtra     = 0;
    WndClsEx.cbWndExtra     = 0;
    WndClsEx.hbrBackground  = (HBRUSH) (COLOR_BTNFACE + 1);
 
    if(!RegisterClassEx(&WndClsEx)) return FALSE;
 
    Hwnd = CreateWindowEx(0,"MyWindows", "", WS_POPUP,0,1020,1680,30,NULL, NULL, Hinstance, NULL);
    if (!Hwnd)  return FALSE;
 
    ShowWindow(Hwnd, nCmdShow);
 
    SetWindowPos(Hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
 
    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
    return msg.wParam;
} | 
Partager