| 397 | } |
| 398 | |
| 399 | STDMETHODIMP CProgressBarControl::put_Value(SHORT value) { |
| 400 | if (m_innerHwnd == NULL) { |
| 401 | return E_FAIL; |
| 402 | } |
| 403 | |
| 404 | ULONG_PTR cookie; |
| 405 | IsolationAwareStart(&cookie); |
| 406 | |
| 407 | if (value == -1) { |
| 408 | // Marquee style |
| 409 | SetWindowLongPtr(m_innerHwnd, GWL_STYLE, GetWindowLongPtr(m_innerHwnd, GWL_STYLE) | PBS_MARQUEE); |
| 410 | SendMessage(m_innerHwnd, PBM_SETMARQUEE, TRUE, 100); |
| 411 | } else { |
| 412 | // Normal style |
| 413 | SHORT oldValue = -1; |
| 414 | get_Value(&oldValue); |
| 415 | if (oldValue == -1) { |
| 416 | SendMessage(m_innerHwnd, PBM_SETMARQUEE, FALSE, 0); |
| 417 | SetWindowLongPtr(m_innerHwnd, GWL_STYLE, GetWindowLongPtr(m_innerHwnd, GWL_STYLE) & ~PBS_MARQUEE); |
| 418 | SendMessage(m_innerHwnd, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); |
| 419 | } |
| 420 | |
| 421 | SendMessage(m_innerHwnd, PBM_SETPOS, value, 0); |
| 422 | } |
| 423 | |
| 424 | IsolationAwareEnd(&cookie); |
| 425 | InvalidateContainer(); |
| 426 | |
| 427 | return S_OK; |
| 428 | } |
nothing calls this directly
no test coverage detected