update to a less ancient Devel::CheckLib
[imager-screenshot.git] / svwin32.c
CommitLineData
6f00ec2f
TC
1#include "svwin32.h"
2
3SSHWND
4hwnd_from_sv(pTHX_ SV *sv) {
5 SvGETMAGIC(sv);
6
956a3577
TC
7 if (!SvOK(sv)) {
8 return 0;
9 }
6f00ec2f
TC
10 if (SvPOK(sv)) {
11 STRLEN len;
12 char const *p = SvPV_nomg(sv, len);
13
14 if (len == 6 && strEQ(p, "active")) {
15 return (SSHWND)GetForegroundWindow();
16 }
6f00ec2f
TC
17 }
18
19 return SvUV_nomg(sv);
20}