| 12
 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
 
 | #include <iostream>
#include <windows.h>
#include "resource.h"
#include "main.h"
 
 
///////////////////////////////////////////////////////////
 
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	WNDCLASSEX main;
	main.cbSize = sizeof(WNDCLASSEX);
	main.style = CS_HREDRAW|CS_VREDRAW;
	main.lpfnWndProc = MainProc;
	main.cbClsExtra = 0;
	main.cbWndExtra = 0;
	main.hInstance = hInstance;
	main.hIcon = LoadIcon(hInstance, "APPICON");
	main.hIconSm = LoadIcon(hInstance, "WINICON");
	main.hCursor = LoadCursor(NULL, IDC_ARROW);
	main.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1);
	main.lpszMenuName = NULL;
	main.lpszClassName = "std";
	RegisterClassEx(&main);
	HWND hWnd;
	hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, "std", "Installation", WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 609, 429, NULL, NULL, hInstance, NULL);
	ShowWindow(hWnd, SW_SHOW);
	SetTimer(hWnd, NULL, 1000, NULL);
	MSG messages;
 
	while(GetMessage(&messages, NULL, 0, 0) == TRUE)
	{
		TranslateMessage(&messages);
		DispatchMessage(&messages);
	}
 
	return 0;
}
 
///////////////////////////////////////////////////////////
 
LRESULT CALLBACK MainProc(HWND hWnd, UINT messages, WPARAM wParam, LPARAM lParam)
{
	switch (messages)
	{
		HINSTANCE hInstance;
 
		case WM_PAINT:
			HBITMAP hBmp;
			HDC hDC;
			hBmp = (HBITMAP)LoadImage(hInstance, "BGSTEP1", IMAGE_BITMAP, 0, 0, NULL);
			hDC = GetDC(hWnd);
			DrawState(hDC, NULL, NULL, (LPARAM)hBmp, NULL, 0, 0, 0, 0, DST_BITMAP);
			DeleteObject(hBmp);
			ReleaseDC(hWnd, hDC);
		return 0;
 
		case WM_CLOSE:
            if(MessageBox(hWnd, "Êtes vous sûr de vouloir annuler l'installation ?", "Installation", MB_YESNO|MB_ICONQUESTION) == IDYES)
				DestroyWindow(hWnd);
		break;
 
		case WM_DESTROY:
			PostQuitMessage(0);
		break;
 
		default:
		return DefWindowProc(hWnd, messages, wParam, lParam);
	}
} | 
Partager