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
   |  
int APIENTRY WinMain(HINSTANCE hIns, HINSTANCE hPrevIns, LPSTR lpCmdLine, int nCmdShow)
//	***********************************************************************************
{
    WNDCLASS	wc;
    HWND	hWnd;
    MSG 	msg;
 
    trace("WinMain(hIns=0x%x, hPrevIns=0x%x, lpCmdLine=\"%s\", nCmdShow=0x%x)\n", hIns, hPrevIns, lpCmdLine, nCmdShow);
 
    wc.style = 0;
    wc.lpfnWndProc = WinUraWinProc;
    wc.cbClsExtra = 0;
    wc.cbWndExtra = 0;
    wc.hInstance = hIns;
    wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
    wc.lpszMenuName = "WinUraMenu";
    wc.lpszClassName = "WinUraWC";
 
    if (!RegisterClass(&wc))
    {
		Message("RegisterClass(\"WinUra\") impossible\n");
		return 0;
    }
 
 
	wc.style = 0;
	wc.lpfnWndProc = WinPhotoProc;
	wc.cbClsExtra = 0;
	wc.cbWndExtra = 0;
	wc.hInstance = hIns;
	wc.hIcon = NULL;
	wc.hCursor = LoadCursor(NULL, IDC_ARROW);
	wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
	wc.lpszMenuName = "";
	wc.lpszClassName = "Photo";
 
	if (!RegisterClass(&wc))
		{
		//Message("RegisterClass(\"WinUra\") impossible\n");
		return 0;
		}
 
    hInst = hIns;
 
    hWnd = CreateWindow("WinUraWC",
						"WinUra",
						WS_OVERLAPPEDWINDOW,
						CW_USEDEFAULT,
						CW_USEDEFAULT,
						CW_USEDEFAULT,
						CW_USEDEFAULT,
						NULL,
						NULL,
						hIns,
						NULL);
 
    ShowWindow(hWnd, nCmdShow);
    UpdateWindow(hWnd);
	if (!Photo0.Create(hIns, hWnd)) return 0;
 
	if (!Init(Photo0.hWnd))
		return 0;
	ForceClientAreaSize(hWnd, 720, 578);
	hAccel = LoadAccelerators(hInst, MAKEINTRESOURCE(IDC_WinUra));
	SetTimer(hWnd, 0, 1000, NULL);
    while(GetMessage(&msg, NULL, 0, 0))
    {
		if ((hAccel == NULL) || !TranslateAccelerator(hWnd, hAccel, &msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);
		}
    }
    trace("Sortie de la boucle des messages\n");
	Term(Photo0.hWnd);
    return msg.wParam;
} | 
Partager