121
This commit is contained in:
parent
653adcd041
commit
bdca4f84a3
295
67.cpp
Normal file
295
67.cpp
Normal file
@ -0,0 +1,295 @@
|
||||
// ëàáà 6.cpp : Îïðåäåëÿåò òî÷êó âõîäà äëÿ ïðèëîæåíèÿ.
|
||||
//
|
||||
|
||||
#include "framework.h"
|
||||
#include "ëàáà 6.h"
|
||||
|
||||
#define MAX_LOADSTRING 100
|
||||
|
||||
// Ãëîáàëüíûå ïåðåìåííûå:
|
||||
HINSTANCE hInst; // òåêóùèé ýêçåìïëÿð
|
||||
WCHAR szTitle[MAX_LOADSTRING]; // Òåêñò ñòðîêè çàãîëîâêà
|
||||
WCHAR szWindowClass[MAX_LOADSTRING]; // èìÿ êëàññà ãëàâíîãî îêíà
|
||||
|
||||
// Îòïðàâèòü îáúÿâëåíèÿ ôóíêöèé, âêëþ÷åííûõ â ýòîò ìîäóëü êîäà:
|
||||
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: Ðàçìåñòèòå êîä çäåñü.
|
||||
|
||||
// Èíèöèàëèçàöèÿ ãëîáàëüíûõ ñòðîê
|
||||
LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
LoadStringW(hInstance, IDC_MY6, szWindowClass, MAX_LOADSTRING);
|
||||
MyRegisterClass(hInstance);
|
||||
|
||||
// Âûïîëíèòü èíèöèàëèçàöèþ ïðèëîæåíèÿ:
|
||||
if (!InitInstance(hInstance, nCmdShow))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MY6));
|
||||
|
||||
MSG msg;
|
||||
|
||||
// Öèêë îñíîâíîãî ñîîáùåíèÿ:
|
||||
while (GetMessage(&msg, nullptr, 0, 0))
|
||||
{
|
||||
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
}
|
||||
|
||||
return (int)msg.wParam;
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// ÔÓÍÊÖÈß: MyRegisterClass()
|
||||
//
|
||||
// ÖÅËÜ: Ðåãèñòðèðóåò êëàññ îêíà.
|
||||
//
|
||||
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_MY6));
|
||||
wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
|
||||
wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_MY6);
|
||||
wcex.lpszClassName = szWindowClass;
|
||||
wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
|
||||
return RegisterClassExW(&wcex);
|
||||
}
|
||||
|
||||
//
|
||||
// ÔÓÍÊÖÈß: InitInstance(HINSTANCE, int)
|
||||
//
|
||||
// ÖÅËÜ: Ñîõðàíÿåò ìàðêåð ýêçåìïëÿðà è ñîçäàåò ãëàâíîå îêíî
|
||||
//
|
||||
// ÊÎÌÌÅÍÒÀÐÈÈ:
|
||||
//
|
||||
// Â ýòîé ôóíêöèè ìàðêåð ýêçåìïëÿðà ñîõðàíÿåòñÿ â ãëîáàëüíîé ïåðåìåííîé, à òàêæå
|
||||
// ñîçäàåòñÿ è âûâîäèòñÿ ãëàâíîå îêíî ïðîãðàììû.
|
||||
//
|
||||
BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
{
|
||||
hInst = hInstance; // Ñîõðàíèòü ìàðêåð ýêçåìïëÿðà â ãëîáàëüíîé ïåðåìåííîé
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
//
|
||||
// ÔÓÍÊÖÈß: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
//
|
||||
// ÖÅËÜ: Îáðàáàòûâàåò ñîîáùåíèÿ â ãëàâíîì îêíå.
|
||||
//
|
||||
// WM_COMMAND - îáðàáîòàòü ìåíþ ïðèëîæåíèÿ
|
||||
// WM_PAINT - Îòðèñîâêà ãëàâíîãî îêíà
|
||||
// WM_DESTROY - îòïðàâèòü ñîîáùåíèå î âûõîäå è âåðíóòüñÿ
|
||||
//
|
||||
//
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message)
|
||||
{
|
||||
case WM_COMMAND:
|
||||
{
|
||||
int wmId = LOWORD(wParam);
|
||||
// Ðàçîáðàòü âûáîð â ìåíþ:
|
||||
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: Äîáàâüòå ñþäà ëþáîé êîä ïðîðèñîâêè, èñïîëüçóþùèé HDC...
|
||||
int x1 = 447, y1 = 128;
|
||||
int x2 = 447, y2 = 332;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 -= 10;
|
||||
y1 += 10;
|
||||
x2 += 10;
|
||||
y2 -= 10;
|
||||
} while (x2 <= 600);
|
||||
|
||||
x1 = 390, y1 = 570;
|
||||
x2 = 550, y2 = 570;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 += 10;
|
||||
y2 -= 7;
|
||||
} while (y2 >= 455);
|
||||
|
||||
|
||||
|
||||
x1 = 750, y1 = 570;
|
||||
x2 = 750, y2 = 452;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x2 -= 5;
|
||||
y1 -= 5;
|
||||
y2 += 5;
|
||||
} while (x2 >= 670);
|
||||
|
||||
x1 = 950, y1 = 570;
|
||||
x2 = 1050, y2 = 570;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
|
||||
y1 -= 5;
|
||||
y2 += 10;
|
||||
} while (y1 >= 500);
|
||||
x1 = 950, y1 = 170;
|
||||
x2 = 1000, y2 = 150;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
y2 -= 7;
|
||||
x1 -= 7;
|
||||
} while (y2 >= 80);
|
||||
|
||||
x1 = 750, y1 = 170;
|
||||
x2 = 750, y2 = 370;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 += 7;
|
||||
x2 -= 7;
|
||||
} while (x2 >= 650);
|
||||
|
||||
x1 = 150, y1 = 170;
|
||||
x2 = 150, y2 = 370;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 += 5;
|
||||
y2 -= 5;
|
||||
|
||||
} while (x1 <= 300);
|
||||
|
||||
x1 = 150, y1 = 470;
|
||||
x2 = 150, y2 = 670;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 += 5;
|
||||
x2 += 5;
|
||||
y1 -= 5;
|
||||
y2 += 5;
|
||||
} while (x1 <= 200);
|
||||
|
||||
x1 = 150, y1 = 70;
|
||||
x2 = 150, y2 = 130;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 += 5;
|
||||
x2 += 5;
|
||||
y1 += 5;
|
||||
y2 -= 5;
|
||||
} while (x1 <= 180);
|
||||
|
||||
x1 = 220, y1 = 60;
|
||||
x2 = 220, y2 = 140;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 -= 5;
|
||||
x2 -= 5;
|
||||
y1 += 5;
|
||||
y2 -= 5;
|
||||
} while (x1 >= 180);
|
||||
|
||||
x1 = 1220, y1 = 60;
|
||||
x2 = 1340, y2 = 160;
|
||||
do {
|
||||
MoveToEx(hdc, x1, y1, NULL);
|
||||
LineTo(hdc, x2, y2);
|
||||
x1 += 10;
|
||||
x2 += 3;
|
||||
y2 -= 5;
|
||||
y1 += 5;
|
||||
} while (x1 <= 1440);
|
||||
|
||||
|
||||
|
||||
EndPaint(hWnd, &ps);
|
||||
}
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
PostQuitMessage(0);
|
||||
break;
|
||||
default:
|
||||
return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Îáðàáîò÷èê ñîîáùåíèé äëÿ îêíà "Î ïðîãðàììå".
|
||||
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;
|
||||
}
|
BIN
ResTempl.rct
Normal file
BIN
ResTempl.rct
Normal file
Binary file not shown.
BIN
Resource.aps
Normal file
BIN
Resource.aps
Normal file
Binary file not shown.
30
Resource.h
Normal file
30
Resource.h
Normal file
@ -0,0 +1,30 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Включаемый файл, созданный в Microsoft Visual C++.
|
||||
// Используется лаба 6.rc
|
||||
|
||||
#define IDS_APP_TITLE 103
|
||||
|
||||
#define IDR_MAINFRAME 128
|
||||
#define IDD_MY6_DIALOG 102
|
||||
#define IDD_ABOUTBOX 103
|
||||
#define IDM_ABOUT 104
|
||||
#define IDM_EXIT 105
|
||||
#define IDI_MY6 107
|
||||
#define IDI_SMALL 108
|
||||
#define IDC_MY6 109
|
||||
#define IDC_MYICON 2
|
||||
#ifndef IDC_STATIC
|
||||
#define IDC_STATIC -1
|
||||
#endif
|
||||
// Следующие стандартные значения для новых объектов
|
||||
//
|
||||
#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
|
BIN
Resource.rc
Normal file
BIN
Resource.rc
Normal file
Binary file not shown.
15
framework.h
Normal file
15
framework.h
Normal file
@ -0,0 +1,15 @@
|
||||
// header.h: включаемый файл для стандартных системных включаемых файлов
|
||||
// или включаемые файлы для конкретного проекта
|
||||
//
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "targetver.h"
|
||||
#define WIN32_LEAN_AND_MEAN // Исключите редко используемые компоненты из заголовков Windows
|
||||
// Файлы заголовков Windows
|
||||
#include <windows.h>
|
||||
// Файлы заголовков среды выполнения C
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <memory.h>
|
||||
#include <tchar.h>
|
14
resource1.h
Normal file
14
resource1.h
Normal file
@ -0,0 +1,14 @@
|
||||
//{{NO_DEPENDENCIES}}
|
||||
// Microsoft Visual C++ generated include file.
|
||||
// Used by Resource.rc
|
||||
|
||||
// Ñëåäóþùèå ñòàíäàðòíûå çíà÷åíèÿ äëÿ íîâûõ îáúåêòîâ
|
||||
//
|
||||
#ifdef APSTUDIO_INVOKED
|
||||
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||
#define _APS_NEXT_SYMED_VALUE 101
|
||||
#endif
|
||||
#endif
|
6
targetver.h
Normal file
6
targetver.h
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
// // При включении SDKDDKVer.h будет задана самая новая из доступных платформ Windows.
|
||||
// Если вы планируете сборку приложения для предыдущей версии платформы Windows, включите WinSDKVer.h и
|
||||
// задайте желаемую платформу в макросе _WIN32_WINNT, прежде чем включать SDKDDKVer.h.
|
||||
#include <SDKDDKVer.h>
|
BIN
x64/Debug/лаба 6.exe
Normal file
BIN
x64/Debug/лаба 6.exe
Normal file
Binary file not shown.
BIN
x64/Debug/лаба 6.pdb
Normal file
BIN
x64/Debug/лаба 6.pdb
Normal file
Binary file not shown.
269
лаба 6.cpp
Normal file
269
лаба 6.cpp
Normal file
@ -0,0 +1,269 @@
|
||||
//// лаба 6.cpp : Определяет точку входа для приложения.
|
||||
////
|
||||
//
|
||||
//#include "framework.h"
|
||||
//#include "лаба 6.h"
|
||||
//
|
||||
//#define MAX_LOADSTRING 100
|
||||
//
|
||||
//// Глобальные переменные:
|
||||
//HINSTANCE hInst; // текущий экземпляр
|
||||
//WCHAR szTitle[MAX_LOADSTRING]; // Текст строки заголовка
|
||||
//WCHAR szWindowClass[MAX_LOADSTRING]; // имя класса главного окна
|
||||
//
|
||||
//// Отправить объявления функций, включенных в этот модуль кода:
|
||||
//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: Разместите код здесь.
|
||||
//
|
||||
// // Инициализация глобальных строк
|
||||
// LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING);
|
||||
// LoadStringW(hInstance, IDC_MY6, szWindowClass, MAX_LOADSTRING);
|
||||
// MyRegisterClass(hInstance);
|
||||
//
|
||||
// // Выполнить инициализацию приложения:
|
||||
// if (!InitInstance (hInstance, nCmdShow))
|
||||
// {
|
||||
// return FALSE;
|
||||
// }
|
||||
//
|
||||
// HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_MY6));
|
||||
//
|
||||
// MSG msg;
|
||||
//
|
||||
// // Цикл основного сообщения:
|
||||
// while (GetMessage(&msg, nullptr, 0, 0))
|
||||
// {
|
||||
// if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg))
|
||||
// {
|
||||
// TranslateMessage(&msg);
|
||||
// DispatchMessage(&msg);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return (int) msg.wParam;
|
||||
//}
|
||||
//
|
||||
//
|
||||
//
|
||||
////
|
||||
//// ФУНКЦИЯ: MyRegisterClass()
|
||||
////
|
||||
//// ЦЕЛЬ: Регистрирует класс окна.
|
||||
////
|
||||
//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_MY6));
|
||||
// wcex.hCursor = LoadCursor(nullptr, IDC_ARROW);
|
||||
// wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
|
||||
// wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_MY6);
|
||||
// wcex.lpszClassName = szWindowClass;
|
||||
// wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL));
|
||||
//
|
||||
// return RegisterClassExW(&wcex);
|
||||
//}
|
||||
//
|
||||
////
|
||||
//// ФУНКЦИЯ: InitInstance(HINSTANCE, int)
|
||||
////
|
||||
//// ЦЕЛЬ: Сохраняет маркер экземпляра и создает главное окно
|
||||
////
|
||||
//// КОММЕНТАРИИ:
|
||||
////
|
||||
//// В этой функции маркер экземпляра сохраняется в глобальной переменной, а также
|
||||
//// создается и выводится главное окно программы.
|
||||
////
|
||||
//BOOL InitInstance(HINSTANCE hInstance, int nCmdShow)
|
||||
//{
|
||||
// hInst = hInstance; // Сохранить маркер экземпляра в глобальной переменной
|
||||
//
|
||||
// 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;
|
||||
//}
|
||||
//
|
||||
////
|
||||
//// ФУНКЦИЯ: WndProc(HWND, UINT, WPARAM, LPARAM)
|
||||
////
|
||||
//// ЦЕЛЬ: Обрабатывает сообщения в главном окне.
|
||||
////
|
||||
//// WM_COMMAND - обработать меню приложения
|
||||
//// WM_PAINT - Отрисовка главного окна
|
||||
//// WM_DESTROY - отправить сообщение о выходе и вернуться
|
||||
////
|
||||
////
|
||||
//LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
//{
|
||||
// switch (message)
|
||||
// {
|
||||
// case WM_COMMAND:
|
||||
// {
|
||||
// int wmId = LOWORD(wParam);
|
||||
// // Разобрать выбор в меню:
|
||||
// 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: Добавьте сюда любой код прорисовки, использующий HDC...
|
||||
// int x1 = 500, y1 = 160;
|
||||
// int x2 = 600, y2 = 260;
|
||||
// do {
|
||||
// MoveToEx(hdc, x1, y1, NULL);
|
||||
// LineTo(hdc, x2, y2);
|
||||
// x1 += 20;
|
||||
// } while (x1 <= 900);
|
||||
//
|
||||
// x1 = 0, y1 = 250;
|
||||
// x2 = 100, y2 = 250;
|
||||
// do {
|
||||
// MoveToEx(hdc, x1, y1, NULL);
|
||||
// LineTo(hdc, x2, y2);
|
||||
// x1 += 5;
|
||||
// y1 -= 10;
|
||||
// } while (x1 <= 100);
|
||||
//
|
||||
// x1 = 100, y1 = 50;
|
||||
// do {
|
||||
// MoveToEx(hdc, x1, y1, NULL);
|
||||
// LineTo(hdc, x2, y2);
|
||||
// x1 += 5;
|
||||
// y1 += 10;
|
||||
// } while (x1 <= 200);
|
||||
//
|
||||
// x1 = 150, y1 = 0;
|
||||
// x2 = 150, y2 = 100;
|
||||
// do {
|
||||
// MoveToEx(hdc, x1, y1, NULL);
|
||||
// LineTo(hdc, x2, y2);
|
||||
// x1 += 5;
|
||||
// x2 += 5;
|
||||
// } while (x1 <= 450);
|
||||
//
|
||||
// HPEN hPen;
|
||||
// hPen = CreatePen(PS_SOLID, 5, RGB(185, 127, 87));
|
||||
// SelectObject(hdc, hPen);
|
||||
//
|
||||
// x1 = 150, y1 = 500;
|
||||
// x2 = 150, y2 = 600;
|
||||
// do {
|
||||
// MoveToEx(hdc, x1, y1, NULL);
|
||||
// LineTo(hdc, x2, y2);
|
||||
// x1 += 25;
|
||||
// x2 += 25;
|
||||
// } while (x1 <= 650);
|
||||
// hPen = CreatePen(PS_SOLID, 5, RGB(0, 0, 0));
|
||||
// SelectObject(hdc, hPen);
|
||||
//
|
||||
// hPen = CreatePen(PS_SOLID, 5, RGB(0, 255, 0));
|
||||
// SelectObject(hdc, hPen);
|
||||
//
|
||||
// x1 = 150, y1 = 650;
|
||||
// x2 = 150, y2 = 700;
|
||||
// do {
|
||||
// MoveToEx(hdc, x1, y1, NULL);
|
||||
// LineTo(hdc, x2, y2);
|
||||
// x1 += 15;
|
||||
// x2 += 15;
|
||||
// } while (x1 <= 650);
|
||||
// hPen = CreatePen(PS_SOLID, 5, RGB(0, 0, 0));
|
||||
// SelectObject(hdc, hPen);
|
||||
//
|
||||
//
|
||||
// //дом
|
||||
// MoveToEx(hdc, 337, 220, NULL);
|
||||
// LineTo(hdc, 465, 335);
|
||||
// LineTo(hdc, 213, 335);
|
||||
// LineTo(hdc, 337, 220);
|
||||
// LineTo(hdc, 465, 335);
|
||||
// LineTo(hdc, 465, 472);
|
||||
// LineTo(hdc, 586, 473);
|
||||
// LineTo(hdc, 586, 457);
|
||||
// LineTo(hdc, 530, 457);
|
||||
// LineTo(hdc, 530, 442);
|
||||
// LineTo(hdc, 465, 441);
|
||||
// LineTo(hdc, 465, 472);
|
||||
// LineTo(hdc, 213, 472);
|
||||
// LineTo(hdc, 213, 335);
|
||||
//
|
||||
// MoveToEx(hdc, 293, 378, NULL);
|
||||
// LineTo(hdc, 366, 378);
|
||||
// LineTo(hdc, 366, 432);
|
||||
// LineTo(hdc, 293, 432);
|
||||
// LineTo(hdc, 293, 378);
|
||||
// LineTo(hdc, 330, 378);
|
||||
// LineTo(hdc, 329, 432);
|
||||
// LineTo(hdc, 329, 403);
|
||||
// LineTo(hdc, 292, 403);
|
||||
// EndPaint(hWnd, &ps);
|
||||
// }
|
||||
// break;
|
||||
// case WM_DESTROY:
|
||||
// PostQuitMessage(0);
|
||||
// break;
|
||||
// default:
|
||||
// return DefWindowProc(hWnd, message, wParam, lParam);
|
||||
// }
|
||||
// return 0;
|
||||
//}
|
||||
//
|
||||
//// Обработчик сообщений для окна "О программе".
|
||||
//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;
|
||||
//}
|
BIN
лаба 6.ico
Normal file
BIN
лаба 6.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 45 KiB |
31
лаба 6.sln
Normal file
31
лаба 6.sln
Normal file
@ -0,0 +1,31 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 17
|
||||
VisualStudioVersion = 17.12.35209.166
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "лаба 6", "лаба 6.vcxproj", "{183476D8-D9A8-4727-8070-5E66D26369E0}"
|
||||
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
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Debug|x64.Build.0 = Debug|x64
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Debug|x86.ActiveCfg = Debug|Win32
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Debug|x86.Build.0 = Debug|Win32
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Release|x64.ActiveCfg = Release|x64
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Release|x64.Build.0 = Release|x64
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Release|x86.ActiveCfg = Release|Win32
|
||||
{183476D8-D9A8-4727-8070-5E66D26369E0}.Release|x86.Build.0 = Release|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {8A43FB55-9C1F-45EC-8948-1DD862C09B78}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
149
лаба 6.vcxproj
Normal file
149
лаба 6.vcxproj
Normal file
@ -0,0 +1,149 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|Win32">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|Win32">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>Win32</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<VCProjectVersion>17.0</VCProjectVersion>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<ProjectGuid>{183476d8-d9a8-4727-8070-5e66d26369e0}</ProjectGuid>
|
||||
<RootNamespace>лаба6</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="Shared">
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<PreprocessorDefinitions>NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ConformanceMode>true</ConformanceMode>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||
<OptimizeReferences>true</OptimizeReferences>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h" />
|
||||
<ClInclude Include="Resource.h" />
|
||||
<ClInclude Include="targetver.h" />
|
||||
<ClInclude Include="лаба 6.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="67.cpp" />
|
||||
<ClCompile Include="лаба 6.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="лаба 6.rc" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="small.ico" />
|
||||
<Image Include="лаба 6.ico" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
52
лаба 6.vcxproj.filters
Normal file
52
лаба 6.vcxproj.filters
Normal file
@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Исходные файлы">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы заголовков">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Файлы ресурсов">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="framework.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="targetver.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Resource.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="лаба 6.h">
|
||||
<Filter>Файлы заголовков</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="лаба 6.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="67.cpp">
|
||||
<Filter>Исходные файлы</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="лаба 6.rc">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="small.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
<Image Include="лаба 6.ico">
|
||||
<Filter>Файлы ресурсов</Filter>
|
||||
</Image>
|
||||
</ItemGroup>
|
||||
</Project>
|
4
лаба 6.vcxproj.user
Normal file
4
лаба 6.vcxproj.user
Normal file
@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
</Project>
|
Loading…
Reference in New Issue
Block a user