-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
51 lines (42 loc) · 1.02 KB
/
main.cpp
File metadata and controls
51 lines (42 loc) · 1.02 KB
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
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <Windows.h>
#include <conio.h>
#include <tchar.h>
#include <ctime>
#include <strsafe.h>
#include <stdlib.h>
#include "DDB.h"
using namespace std;
DDayBook a;//îãîëîøåííÿ êëàñîâî¿ çì³ííî¿
int Title(STRSAFE_LPCSTR titlename, const char* titletext)
{
TCHAR szOldTitle[MAX_PATH];
TCHAR szNewTitle[MAX_PATH];
// Çáåðåæåííÿ àêòóàëüíî¿ íàçâè êîíñîë³.
if( GetConsoleTitle(szOldTitle, MAX_PATH) )
{
// Ñòâîðåííÿ íîâîãî string íàçâè êîíñîë³.
StringCchPrintf(szNewTitle, MAX_PATH, TEXT(titlename));
// Çàì³íà íàçâè êîíñîë³ íîâîþ íàçâîþ êîíñîë³
if( !SetConsoleTitle(szNewTitle) )
{
_tprintf(TEXT("SetConsoleTitle failed (%d)\n"), GetLastError());
return 1;
}
else
{
_tprintf(TEXT(titletext));
}
}
return 0;
}
STRSAFE_LPCSTR version = "DDayBook v.1.0";
int main()
{
Title( version, "Hi there!");
setlocale(LC_CTYPE, "ukr");
a.main_menu();//âèâ³ä ìåíþ ïðîãðàìè
return 0;
}