XS(XS_NT__Setupsup_GetWindowProperties) { dXSARGS; // reset last error LastError(0); // window parameter SV *window = NULL; AV *propToGet = NULL; HV *windowProp = NULL; HV **clearRect = NULL; // check arguments if(items == 3 && SvIOKp(window = ST(0)) && SvROK(propToGet = (AV*)ST(1)) && SvTYPE(propToGet = (AV*)SvRV(propToGet)) == SVt_PVAV && SvROK(windowProp = (HV*)ST(2)) && SvTYPE(windowProp = (HV*)SvRV(windowProp)) == SVt_PVHV) { // get window handle HWND hWnd = (HWND)SvIV(window); // clear reference clearRect = (HV**)hv_fetch(windowProp, PROP_RECT, strlen(PROP_RECT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); clearRect = (HV**)hv_fetch(windowProp, PROP_CLIENT, strlen(PROP_CLIENT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); hv_clear(windowProp); for(int count = 0; count <= av_len(propToGet); count++) { SV **curPropToGet = NULL; PSTR curPropToGetName = NULL; int curPropToGetIdx = 0; // look for app. property index if(!(curPropToGet = av_fetch(propToGet, count, 0)) || !(curPropToGetName = SvPV(*curPropToGet, PL_na)) || !(curPropToGetIdx = GetPropertyIndex(curPropToGetName))) { LastError(UNKNOWN_PROPERTY_ERROR); clearRect = (HV**)hv_fetch(windowProp, PROP_RECT, strlen(PROP_RECT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); clearRect = (HV**)hv_fetch(windowProp, PROP_CLIENT, strlen(PROP_CLIENT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); hv_clear(windowProp); break; } // now get and store the property if(!GetAndStoreWindowProp(hWnd, curPropToGetIdx, P_PERL windowProp)) { clearRect = (HV**)hv_fetch(windowProp, PROP_RECT, strlen(PROP_RECT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); clearRect = (HV**)hv_fetch(windowProp, PROP_CLIENT, strlen(PROP_CLIENT), 0); if(clearRect && *clearRect) hv_clear(*clearRect); hv_clear(windowProp); break; } } } else croak("Usage: Win32::Setupsup::GetWindowProperties($window, @proptoget, " "\\%%windowprop)\n"); RETURNRESULT(!LastError()); }