()
| 12 | |
| 13 | |
| 14 | def main(): |
| 15 | cef.Initialize() |
| 16 | window_info = cef.WindowInfo() |
| 17 | parent_handle = 0 |
| 18 | # This call has effect only on Mac and Linux. |
| 19 | # All rect coordinates are applied including X and Y parameters. |
| 20 | window_info.SetAsChild(parent_handle, [0, 0, 900, 640]) |
| 21 | browser = cef.CreateBrowserSync(url="https://www.google.com/", |
| 22 | window_info=window_info, |
| 23 | window_title="Window size") |
| 24 | if platform.system() == "Windows": |
| 25 | window_handle = browser.GetOuterWindowHandle() |
| 26 | insert_after_handle = 0 |
| 27 | # X and Y parameters are ignored by setting the SWP_NOMOVE flag |
| 28 | SWP_NOMOVE = 0x0002 |
| 29 | # noinspection PyUnresolvedReferences |
| 30 | ctypes.windll.user32.SetWindowPos(window_handle, insert_after_handle, |
| 31 | 0, 0, 900, 640, SWP_NOMOVE) |
| 32 | cef.MessageLoop() |
| 33 | del browser |
| 34 | cef.Shutdown() |
| 35 | |
| 36 | |
| 37 | if __name__ == '__main__': |
no test coverage detected