MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / DetermineTargetWindow

Function DetermineTargetWindow

source/script2.cpp:9011–9034  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9009
9010
9011ResultType DetermineTargetWindow(HWND &aWindow, ResultToken &aResultToken, ExprTokenType *aParam[], int aParamCount, int aNonWinParamCount)
9012{
9013 if (aParamCount > 0)
9014 {
9015 auto result = DetermineTargetHwnd(aWindow, aResultToken, *aParam[0]);
9016 if (result != CONDITION_FALSE)
9017 {
9018 if (result == OK && !aWindow)
9019 return aResultToken.Error(ERR_NO_WINDOW, ErrorPrototype::Target);
9020 return result;
9021 }
9022 }
9023 TCHAR number_buf[4][MAX_NUMBER_SIZE];
9024 LPTSTR param[4];
9025 for (int i = 0, j = 0; i < 4; ++i, ++j)
9026 {
9027 if (i == 2) j += aNonWinParamCount;
9028 param[i] = j < aParamCount ? TokenToString(*aParam[j], number_buf[i]) : _T("");
9029 }
9030 aWindow = Line::DetermineTargetWindow(param[0], param[1], param[2], param[3]);
9031 if (aWindow)
9032 return OK;
9033 return aResultToken.Error(ERR_NO_WINDOW, param[0], ErrorPrototype::Target);
9034}
9035
9036
9037ResultType DetermineTargetControl(HWND &aControl, HWND &aWindow, ResultToken &aResultToken, ExprTokenType *aParam[], int aParamCount

Callers 3

BIF_DECLFunction · 0.85
BIF_DECLFunction · 0.85
DetermineTargetControlFunction · 0.85

Calls 3

DetermineTargetHwndFunction · 0.85
TokenToStringFunction · 0.85
ErrorMethod · 0.80

Tested by

no test coverage detected