|
19 | 19 | #include <WindowsConstants.au3> |
20 | 20 | #include <StaticConstants.au3> |
21 | 21 | #include <EditConstants.au3> |
| 22 | +#include "..\NetWebView2Lib.au3" |
22 | 23 | #include "_WV2_ExtensionPicker.au3" |
23 | 24 |
|
24 | | -OnAutoItExitRegister("_ExitApp") |
| 25 | +OnAutoItExitRegister(_ExitApp) |
25 | 26 |
|
26 | 27 | ; Global Objects & Handles |
27 | 28 | Global $oWeb1, $oWeb2 |
@@ -50,7 +51,7 @@ Func _MainGUI() ; Creates the primary application window and starts the message |
50 | 51 | GUICtrlSetResizing(-1, $GUI_DOCKALL) |
51 | 52 |
|
52 | 53 | ; Register the WM_SIZE message to handle window resizing dynamically |
53 | | - GUIRegisterMsg($WM_SIZE, "WM_SIZE") |
| 54 | + GUIRegisterMsg($WM_SIZE, WM_SIZE) |
54 | 55 |
|
55 | 56 | ; Initialize Browsers and their child window containers |
56 | 57 | _InitBrowsers() |
@@ -168,32 +169,22 @@ Func _InitBrowsers() ; Creates child window containers and initializes WebView2 |
168 | 169 | ; Instance 1 - "Profile_1" folder |
169 | 170 | $hID1 = GUICreate("", 485, 580, 10, 10, BitOR($WS_CHILD, $WS_CLIPCHILDREN), -1, $hMainGUI) |
170 | 171 | $Bar1 = _Web_MakeBar($hID1, $sExtras) |
171 | | - $oWeb1 = ObjCreate("NetWebView2.Manager") |
172 | | - ObjEvent($oWeb1, "Web1_", "IWebViewEvents") |
173 | | - $oBridge1 = $oWeb1.GetBridge() |
174 | | - ObjEvent($oBridge1, "Bridge1_", "IBridgeEvents") |
| 172 | + $oWeb1 = _NetWebView2_CreateManager("", "Web1_") |
| 173 | + $oBridge1 = _NetWebView2_GetBridge($oWeb1, "Bridge1_") |
175 | 174 | $Bar1.Web_ProfilePath = $sProfileDirectory |
176 | | - $oWeb1.Initialize($hID1, $sProfileDirectory, 0, 25, 485, 555) |
| 175 | + _NetWebView2_Initialize($oWeb1, $hID1, $sProfileDirectory, 0, 25, 485, 555, True, True, 1.2, "0x2B2B2B", False) |
| 176 | + _NetWebView2_Navigate($oWeb1, "https://www.google.com/search?q=web1") |
177 | 177 |
|
178 | 178 | ; Instance 2 - "Profile_2" folder |
179 | 179 | $hID2 = GUICreate("", 485, 580, 505, 10, BitOR($WS_CHILD, $WS_CLIPCHILDREN), -1, $hMainGUI) |
180 | 180 | $Bar2 = _Web_MakeBar($hID2, $sExtras) |
181 | | - $oWeb2 = ObjCreate("NetWebView2.Manager") |
182 | | - ObjEvent($oWeb2, "Web2_", "IWebViewEvents") |
183 | | - $oBridge2 = $oWeb2.GetBridge() |
184 | | - ObjEvent($oBridge2, "Bridge2_", "IBridgeEvents") |
| 181 | + $oWeb2 = _NetWebView2_CreateManager("", "Web2_") |
| 182 | + $oBridge2 = _NetWebView2_GetBridge($oWeb2, "Bridge2_") |
185 | 183 | $Bar2.Web_ProfilePath = @ScriptDir & "\Profile_2" |
186 | | - $oWeb2.Initialize($hID2, @ScriptDir & "\Profile_2", 0, 25, 485, 555) |
187 | | - |
188 | | - ; Wait until both instances are ready |
189 | | - Do |
190 | | - Sleep(10) |
191 | | - Until $oWeb1.IsReady And $oWeb2.IsReady |
| 184 | + _NetWebView2_Initialize($oWeb2, $hID2, $sProfileDirectory, 0, 25, 485, 555, True, True, 1.2, "0x2B2B2B", False) |
| 185 | + _NetWebView2_Navigate($oWeb2, "https://www.google.com/search?q=web2") |
192 | 186 |
|
193 | | - _NetWebView2_Navigate($oWeb1, "https://www.google.com/search?q=web1") |
194 | 187 | GUISetState(@SW_SHOWNOACTIVATE, $hID1) |
195 | | - |
196 | | - $oWeb2.Navigate("https://www.google.com/search?q=web2") |
197 | 188 | GUISetState(@SW_SHOWNOACTIVATE, $hID2) |
198 | 189 |
|
199 | 190 | EndFunc ;==>_InitBrowsers |
|
0 commit comments