electron/spec/is-valid-window/src/impl_win.cc

15 lines
256 B
C++

#include "impl.h"
#include <windows.h>
namespace impl {
bool IsValidWindow(char* handle, size_t size) {
if (size != sizeof(HWND))
return false;
HWND window = *reinterpret_cast<HWND*>(handle);
return ::IsWindow(window);
}
} // namespace impl