OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
167 points[1].y = end.y(); | 167 points[1].y = end.y(); |
168 SetDCPenColor(hdc_, ColorToRef(color)); | 168 SetDCPenColor(hdc_, ColorToRef(color)); |
169 Polyline(hdc_, points, 2); | 169 Polyline(hdc_, points, 2); |
170 } | 170 } |
171 | 171 |
172 void ScreenDrawerWin::DrawDot(DesktopVector vect, RgbaColor color) { | 172 void ScreenDrawerWin::DrawDot(DesktopVector vect, RgbaColor color) { |
173 SetPixel(hdc_, vect.x(), vect.y(), ColorToRef(color)); | 173 SetPixel(hdc_, vect.x(), vect.y(), ColorToRef(color)); |
174 } | 174 } |
175 | 175 |
176 void ScreenDrawerWin::BringToFront() { | 176 void ScreenDrawerWin::BringToFront() { |
177 if (SUCCEEDED(SetWindowPos( | 177 if (SetWindowPos(window_, HWND_TOPMOST, 0, 0, 0, 0, |
178 window_, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE))) { | 178 SWP_NOMOVE | SWP_NOSIZE) == TRUE) { |
179 return; | 179 return; |
tommi (sloooow) - chröme
2016/10/20 19:51:20
Nit: Just check for non 0. False has one value, tr
Hzj_jie
2016/10/20 21:13:39
Will value != FALSE better?
| |
180 } | 180 } |
181 | 181 |
182 long ex_style = GetWindowLong(window_, GWL_EXSTYLE); | 182 long ex_style = GetWindowLong(window_, GWL_EXSTYLE); |
183 ex_style |= WS_EX_TOPMOST; | 183 ex_style |= WS_EX_TOPMOST; |
184 if (SetWindowLong(window_, GWL_EXSTYLE, ex_style) != 0) { | 184 if (SetWindowLong(window_, GWL_EXSTYLE, ex_style) != 0) { |
185 return; | 185 return; |
186 } | 186 } |
187 | 187 |
188 BringWindowToTop(window_); | 188 BringWindowToTop(window_); |
189 } | 189 } |
190 | 190 |
191 } // namespace | 191 } // namespace |
192 | 192 |
193 // static | 193 // static |
194 std::unique_ptr<ScreenDrawerLock> ScreenDrawerLock::Create() { | 194 std::unique_ptr<ScreenDrawerLock> ScreenDrawerLock::Create() { |
195 return std::unique_ptr<ScreenDrawerLock>(new ScreenDrawerLockWin()); | 195 return std::unique_ptr<ScreenDrawerLock>(new ScreenDrawerLockWin()); |
196 } | 196 } |
197 | 197 |
198 // static | 198 // static |
199 std::unique_ptr<ScreenDrawer> ScreenDrawer::Create() { | 199 std::unique_ptr<ScreenDrawer> ScreenDrawer::Create() { |
200 return std::unique_ptr<ScreenDrawer>(new ScreenDrawerWin()); | 200 return std::unique_ptr<ScreenDrawer>(new ScreenDrawerWin()); |
201 } | 201 } |
202 | 202 |
203 } // namespace webrtc | 203 } // namespace webrtc |
OLD | NEW |