Skip to content

Commit

Permalink
[Fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
OwlHowlinMornSky committed Apr 12, 2024
1 parent 48a7d2d commit 804f485
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
16 changes: 8 additions & 8 deletions ExampleBasic/ExampleBasic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,9 @@ int TestNormal() {
auto r_capture = ohms::wgc::ICapture::getInstance();
// Find Window.
HWND hwnd = FindWindowW(TargetWindowClass, TargetWindowName);
if (hwnd == NULL) {
return 1;
}

if (TestCaptureMonitor) {
HMONITOR hmonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
HMONITOR hmonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);
if (hmonitor == NULL) {
return 2;
}
Expand All @@ -76,6 +73,9 @@ int TestNormal() {
}
}
else {
if (hwnd == NULL) {
return 1;
}
if (!IsWindow(hwnd) || IsIconic(hwnd)) { // Requirements for capture window.
return 4;
}
Expand Down Expand Up @@ -114,12 +114,9 @@ int TestCallback() {
auto r_capture = ohms::wgc::ICapture::getInstance();
// Find Window.
HWND hwnd = FindWindowW(TargetWindowClass, TargetWindowName);
if (hwnd == NULL) {
return 1;
}

if (TestCaptureMonitor) {
HMONITOR hmonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONULL);
HMONITOR hmonitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);
if (hmonitor == NULL) {
return 2;
}
Expand All @@ -128,6 +125,9 @@ int TestCallback() {
}
}
else {
if (hwnd == NULL) {
return 1;
}
if (!IsWindow(hwnd) || IsIconic(hwnd)) { // Requirements for capture window.
return 4;
}
Expand Down
2 changes: 0 additions & 2 deletions WGC-Capture-with-OpenCV/include/ohms/WGC.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
#include <Windows.h>
#include <opencv2/core/mat.hpp>

#ifdef OHMS_WGC_USE_CALLBACK
#include <functional>
#endif // OHMS_WGC_USE_CALLBACK

namespace ohms {
namespace wgc {
Expand Down

0 comments on commit 804f485

Please sign in to comment.