diff --git a/Project1.sln b/Project1.sln new file mode 100644 index 0000000..25c0951 --- /dev/null +++ b/Project1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.4.33213.308 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project1", "Project1\Project1.vcxproj", "{A0AA5386-4FD4-4D68-9117-7370A86000CB}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Debug|x64.ActiveCfg = Debug|x64 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Debug|x64.Build.0 = Debug|x64 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Debug|x86.ActiveCfg = Debug|Win32 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Debug|x86.Build.0 = Debug|Win32 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Release|x64.ActiveCfg = Release|x64 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Release|x64.Build.0 = Release|x64 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Release|x86.ActiveCfg = Release|Win32 + {A0AA5386-4FD4-4D68-9117-7370A86000CB}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {41444660-248A-4714-8323-671092341C16} + EndGlobalSection +EndGlobal diff --git a/Project1/Project1.cpp b/Project1/Project1.cpp new file mode 100644 index 0000000..4046c01 --- /dev/null +++ b/Project1/Project1.cpp @@ -0,0 +1,181 @@ +// Project1.cpp : Définit le point d'entrée de l'application. +// + +#include "pch.h" +#include "framework.h" +#include "Project1.h" + +#define MAX_LOADSTRING 100 + +// Variables globales : +HINSTANCE hInst; // instance actuelle +WCHAR szTitle[MAX_LOADSTRING]; // Texte de la barre de titre +WCHAR szWindowClass[MAX_LOADSTRING]; // nom de la classe de fenêtre principale + +// Déclarations anticipées des fonctions incluses dans ce module de code : +ATOM MyRegisterClass(HINSTANCE hInstance); +BOOL InitInstance(HINSTANCE, int); +LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); +INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); + +int APIENTRY wWinMain(_In_ HINSTANCE hInstance, + _In_opt_ HINSTANCE hPrevInstance, + _In_ LPWSTR lpCmdLine, + _In_ int nCmdShow) +{ + UNREFERENCED_PARAMETER(hPrevInstance); + UNREFERENCED_PARAMETER(lpCmdLine); + + // TODO: Placez le code ici. + + // Initialise les chaînes globales + LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); + LoadStringW(hInstance, IDC_PROJECT1, szWindowClass, MAX_LOADSTRING); + MyRegisterClass(hInstance); + + // Effectue l'initialisation de l'application : + if (!InitInstance (hInstance, nCmdShow)) + { + return FALSE; + } + + HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_PROJECT1)); + + MSG msg; + + // Boucle de messages principale : + while (GetMessage(&msg, nullptr, 0, 0)) + { + if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) + { + TranslateMessage(&msg); + DispatchMessage(&msg); + } + } + + return (int) msg.wParam; +} + + + +// +// FONCTION : MyRegisterClass() +// +// OBJECTIF : Inscrit la classe de fenêtre. +// +ATOM MyRegisterClass(HINSTANCE hInstance) +{ + WNDCLASSEXW wcex; + + wcex.cbSize = sizeof(WNDCLASSEX); + + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = WndProc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = hInstance; + wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PROJECT1)); + wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); + wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_PROJECT1); + wcex.lpszClassName = szWindowClass; + wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); + + return RegisterClassExW(&wcex); +} + +// +// FONCTION : InitInstance(HINSTANCE, int) +// +// OBJECTIF : enregistre le handle d'instance et crée une fenêtre principale +// +// COMMENTAIRES : +// +// Dans cette fonction, nous enregistrons le handle de l'instance dans une variable globale, puis +// nous créons et affichons la fenêtre principale du programme. +// +BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) +{ + hInst = hInstance; // Stocke le handle d'instance dans la variable globale + + HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr); + + if (!hWnd) + { + return FALSE; + } + + ShowWindow(hWnd, nCmdShow); + UpdateWindow(hWnd); + + return TRUE; +} + +// +// FONCTION : WndProc(HWND, UINT, WPARAM, LPARAM) +// +// OBJECTIF : Traite les messages pour la fenêtre principale. +// +// WM_COMMAND - traite le menu de l'application +// WM_PAINT - Dessine la fenêtre principale +// WM_DESTROY - génère un message d'arrêt et retourne +// +// +LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + { + int wmId = LOWORD(wParam); + // Analyse les sélections de menu : + switch (wmId) + { + case IDM_ABOUT: + DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); + break; + case IDM_EXIT: + DestroyWindow(hWnd); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + } + break; + case WM_PAINT: + { + PAINTSTRUCT ps; + HDC hdc = BeginPaint(hWnd, &ps); + // TODO: Ajoutez ici le code de dessin qui utilise hdc... + EndPaint(hWnd, &ps); + } + break; + case WM_DESTROY: + PostQuitMessage(0); + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + return 0; +} + +// Gestionnaire de messages pour la boîte de dialogue À propos de. +INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) +{ + UNREFERENCED_PARAMETER(lParam); + switch (message) + { + case WM_INITDIALOG: + return (INT_PTR)TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) + { + EndDialog(hDlg, LOWORD(wParam)); + return (INT_PTR)TRUE; + } + break; + } + return (INT_PTR)FALSE; +} diff --git a/Project1/Project1.h b/Project1/Project1.h new file mode 100644 index 0000000..d00d47e --- /dev/null +++ b/Project1/Project1.h @@ -0,0 +1,3 @@ +#pragma once + +#include "resource.h" diff --git a/Project1/Project1.ico b/Project1/Project1.ico new file mode 100644 index 0000000..b3ec03b Binary files /dev/null and b/Project1/Project1.ico differ diff --git a/Project1/Project1.rc b/Project1/Project1.rc new file mode 100644 index 0000000..2f27daf Binary files /dev/null and b/Project1/Project1.rc differ diff --git a/Project1/Project1.vcxproj b/Project1/Project1.vcxproj new file mode 100644 index 0000000..1e90bd8 --- /dev/null +++ b/Project1/Project1.vcxproj @@ -0,0 +1,163 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {a0aa5386-4fd4-4d68-9117-7370a86000cb} + Project1 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + + + + + Level3 + true + _DEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + + + + + Level3 + true + true + true + NDEBUG;_WINDOWS;%(PreprocessorDefinitions) + true + Use + pch.h + + + Windows + true + true + true + + + + + + + + + + + + Create + Create + Create + Create + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Project1/Project1.vcxproj.filters b/Project1/Project1.vcxproj.filters new file mode 100644 index 0000000..ac27649 --- /dev/null +++ b/Project1/Project1.vcxproj.filters @@ -0,0 +1,55 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + Fichiers d%27en-tête + + + + + Fichiers sources + + + Fichiers sources + + + + + Fichiers de ressources + + + + + Fichiers de ressources + + + Fichiers de ressources + + + \ No newline at end of file diff --git a/Project1/Resource.h b/Project1/Resource.h new file mode 100644 index 0000000..dfb9014 --- /dev/null +++ b/Project1/Resource.h @@ -0,0 +1,30 @@ +//{{NO_DEPENDENCIES}} +// Fichier Include généré par Microsoft Visual C++. +// Utilisé par Project1.rc + +#define IDS_APP_TITLE 103 + +#define IDR_MAINFRAME 128 +#define IDD_PROJECT1_DIALOG 102 +#define IDD_ABOUTBOX 103 +#define IDM_ABOUT 104 +#define IDM_EXIT 105 +#define IDI_PROJECT1 107 +#define IDI_SMALL 108 +#define IDC_PROJECT1 109 +#define IDC_MYICON 2 +#ifndef IDC_STATIC +#define IDC_STATIC -1 +#endif +// Valeurs par défaut suivantes des nouveaux objets +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS + +#define _APS_NO_MFC 130 +#define _APS_NEXT_RESOURCE_VALUE 129 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1000 +#define _APS_NEXT_SYMED_VALUE 110 +#endif +#endif diff --git a/Project1/framework.h b/Project1/framework.h new file mode 100644 index 0000000..32f3939 --- /dev/null +++ b/Project1/framework.h @@ -0,0 +1,11 @@ +#pragma once + +#include "targetver.h" +#define WIN32_LEAN_AND_MEAN // Exclure les en-têtes Windows rarement utilisés +// Fichiers d'en-tête Windows +#include +// Fichiers d'en-tête C RunTime +#include +#include +#include +#include diff --git a/Project1/pch.cpp b/Project1/pch.cpp new file mode 100644 index 0000000..4eeebf2 --- /dev/null +++ b/Project1/pch.cpp @@ -0,0 +1,5 @@ +// pch.cpp : fichier source correspondant à l'en-tête précompilé + +#include "pch.h" + +// Quand vous utilisez des en-têtes précompilés, ce fichier source est nécessaire pour la réussite de la compilation. diff --git a/Project1/pch.h b/Project1/pch.h new file mode 100644 index 0000000..32ba33d --- /dev/null +++ b/Project1/pch.h @@ -0,0 +1,13 @@ +// pch.h : Il s'agit d'un fichier d'en-tête précompilé. +// Les fichiers listés ci-dessous sont compilés une seule fois, ce qui améliore les performances de génération des futures builds. +// Cela affecte également les performances d'IntelliSense, notamment la complétion du code et de nombreuses fonctionnalités de navigation du code. +// Toutefois, les fichiers listés ici sont TOUS recompilés si l'un d'entre eux est mis à jour entre les builds. +// N'ajoutez pas de fichiers fréquemment mis à jour ici, car cela annule les gains de performance. + +#ifndef PCH_H +#define PCH_H + +// ajouter les en-têtes à précompiler ici +#include "framework.h" + +#endif //PCH_H diff --git a/Project1/small.ico b/Project1/small.ico new file mode 100644 index 0000000..b3ec03b Binary files /dev/null and b/Project1/small.ico differ diff --git a/Project1/targetver.h b/Project1/targetver.h new file mode 100644 index 0000000..7ec5318 --- /dev/null +++ b/Project1/targetver.h @@ -0,0 +1,6 @@ +#pragma once + +// // L'inclusion de SDKDDKVer.h définit la version de plateforme Windows la plus haute disponible. +// Si vous voulez générer votre application pour une plateforme Windows précédente, incluez WinSDKVer.h et +// définissez la macro _WIN32_WINNT sur la plateforme à prendre en charge avant d'inclure SDKDDKVer.h. +#include