| 2066 | |
| 2067 | |
| 2068 | ResultType GuiType::ControlGetWindowText(ResultToken &aResultToken, GuiControlType &aControl) |
| 2069 | { |
| 2070 | // Set up the result token. |
| 2071 | int length = GetWindowTextLength(aControl.hwnd); // Might be zero, which is properly handled below. |
| 2072 | if (TokenSetResult(aResultToken, NULL, length) != OK) |
| 2073 | return FAIL; // It already displayed the error. |
| 2074 | aResultToken.marker_length = GetWindowText(aControl.hwnd, aResultToken.marker, length+1); |
| 2075 | // MSDN: "If the function succeeds, the return value is the length, in characters, |
| 2076 | // of the copied string, not including the terminating null character." |
| 2077 | // However, GetWindowText() works by sending the control a WM_GETTEXT message, and some |
| 2078 | // controls don't respond correctly. Link controls have been caught including the null |
| 2079 | // terminator in the count, so this works around it: |
| 2080 | if (aResultToken.marker_length && !aResultToken.marker[aResultToken.marker_length-1]) |
| 2081 | --aResultToken.marker_length; |
| 2082 | return OK; |
| 2083 | } |
| 2084 | |
| 2085 | |
| 2086 | void GuiType::ControlRedraw(GuiControlType &aControl, bool aOnlyWithinTab) |
nothing calls this directly
no test coverage detected