This commit is contained in:
Vladimir Golubev 2023-04-01 20:23:44 +03:00
parent fcfc8c2080
commit 84260fa5e9
5 changed files with 24 additions and 17 deletions

View File

@ -3,4 +3,5 @@
#include "Options.h" #include "Options.h"
#include "../functions/addWatermark.h" #include "../functions/addWatermark.h"
#include "../functions/captureScreen.h" #include "../functions/captureScreen.h"
#include "../functions/screenRecorder.h" #include "../functions/screenRecorder.h"
#include "../functions/timeAdd.h"

View File

@ -134,6 +134,7 @@
<ClInclude Include="functions\addWatermark.h" /> <ClInclude Include="functions\addWatermark.h" />
<ClInclude Include="functions\captureScreen.h" /> <ClInclude Include="functions\captureScreen.h" />
<ClInclude Include="functions\screenRecorder.h" /> <ClInclude Include="functions\screenRecorder.h" />
<ClInclude Include="functions\timeAdd.h" />
<ClInclude Include="Include\Include.h" /> <ClInclude Include="Include\Include.h" />
<ClInclude Include="Include\Options.h" /> <ClInclude Include="Include\Options.h" />
<ClInclude Include="Include\stdafx.h" /> <ClInclude Include="Include\stdafx.h" />

View File

@ -1,5 +1,5 @@
#pragma once #pragma once
#include "addWatermark.h" #include "../Include/Include.h"
void screenRecorder(std::string file_video) void screenRecorder(std::string file_video)
{ {

View File

@ -0,0 +1,19 @@
#include "../Include/Include.h"
void timeAdd(HWND hwnd){
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwnd, &ps);
TEXTMETRIC tm;
GetTextMetrics(hdc, &tm);
int x = 10;
int y = tm.tmHeight + 10;
auto currentTime = std::chrono::system_clock::now();
auto currentTime_t = std::chrono::system_clock::to_time_t(currentTime);
char timeStr[100];
strftime(timeStr, 100, "Time: %H:%M:%S", std::localtime(&currentTime_t));
TextOut(hdc, x, y, timeStr, strlen(timeStr));
EndPaint(hwnd, &ps);
}

View File

@ -35,21 +35,7 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
break; break;
case WM_PAINT: case WM_PAINT:
{ {
PAINTSTRUCT ps; timeAdd(hwnd);
HDC hdc = BeginPaint(hwnd, &ps);
TEXTMETRIC tm;
GetTextMetrics(hdc, &tm);
int x = 10;
int y = tm.tmHeight + 10;
auto currentTime = std::chrono::system_clock::now();
auto currentTime_t = std::chrono::system_clock::to_time_t(currentTime);
char timeStr[100];
strftime(timeStr, 100, "Time: %H:%M:%S", std::localtime(&currentTime_t));
TextOut(hdc, x, y, timeStr, strlen(timeStr));
EndPaint(hwnd, &ps);
} }
break; break;
case WM_DESTROY: case WM_DESTROY: