You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 🚀 What's New in v2.0.0-beta.1 - Multi-Instance & Stability Focus
66
+
## 🚀 What's New in v2.0.0-beta.3 - AcceleratorKey Detail & Refactoring
67
67
68
-
This major beta release re-engineers the core event architecture to support professional multi-instance applications and solves long-standing COM deadlock issues with pre-emptive key blocking.
68
+
This update focuses on deep keyboard interception and code modularity.
69
69
70
70
### ⚡ Key Features & Enhancements
71
71
72
-
#### **1. Sender-Aware Event Architecture**
72
+
#### **1. PhysicalKeyStatus Expansion**
73
+
The `OnAcceleratorKeyPressed` event now provides 1:1 access to the underlying Windows keyboard state.
74
+
-**New Properties**: `RepeatCount`, `ScanCode`, `IsExtendedKey`, `IsMenuKeyDown`, `WasKeyDown`, and `IsKeyReleased`.
75
+
-**Use Case**: Detect held keys, distinguish between left/right Alt/Ctrl, and implement complex hotkey logic without Win32 API calls.
73
76
74
-
The entire event system has been refactored for multi-instance reliability. Every event fired from the C# core now provides a "Sender" context.
77
+
#### **2. Performance & Modularity**
78
+
-**Standalone Argument Logic**: Argument wrappers have been moved to dedicated files (e.g., `WebView2AcceleratorKeyPressedEventArgs.cs`).
79
+
-**Lean Core**: Reduced `WebViewManager.cs` complexity by outsourcing event data structures.
75
80
76
-
-**Instance Isolation**: AutoIt scripts can now easily distinguish which WebView2 instance triggered an event using the `parentHandle` parameter.
77
-
-**Sealed Contexts**: The communication bridge is now sealed to its parent manager, preventing message cross-talk in complex multi-window setups.
We have abandoned the legacy synchronous polling for accelerator keys in favor of a proactive, list-based approach.
83
+
## 🚀 What's New in v2.0.0-beta.2 - COM Versioning & Handle Alignment
82
84
83
-
-**`BlockedVirtualKeys`**: Define a list of VK codes (like F5, F12) to be blocked directly by the C# engine.
84
-
-**Performance**: Eliminates the 600ms sync-wait loops, resulting in instant response times and 0% risk of COM re-entrancy deadlocks.
85
-
-**OnAcceleratorKeyPressed**: Still available for monitoring, but the "Handled" logic is now pre-emptively managed by the property list.
85
+
This update introduces the ability to query the DLL version directly and aligns window handles with AutoIt's native format.
86
86
87
-
#### **3. Native Win32 Integration**
87
+
###⚡ Key Features & Enhancements
88
88
89
-
-**`BrowserWindowHandle`**: A new property that exposes the internal `HWND` of the browser control. This allows for advanced parent-child window relationship management and direct Win32 message interception via DLL calls.
All window handles returned by the library (via properties or events) are now formatted as strings compatible with AutoIt's Advanced Window Descriptions.
91
+
-**Direct Compatibility**: Handles like `[HANDLE:0x00010203]` can be passed directly to `WinExists`, `WinSetTitle`, etc., without `HWnd()` conversion.
90
92
91
-
#### **4. Internal Messaging Overlay**
93
+
#### **2. COM Version Exposure**
94
+
You can now access the `.version` property on all primary COM objects.
-**Improved Stability**: A new internal messaging system ensures that background state updates never interfere with the primary UI event loop, ensuring a smoother user experience during heavy navigation sequences.
97
+
#### **3. Stabilized Infrastructure**
98
+
-**GUID Collision Resolution**: Fixed internal interface IDs that caused registration issues in v2.0.0-beta.1.
99
+
-**`ParentWindowHandle`**: New property to retrieve the handle passed during initialization.
## 📖 NetWebView2Lib Version 2.0.0-beta.1 (Quick Reference)
106
+
## 📖 NetWebView2Lib Version 2.0.0-beta.3 (Quick Reference)
101
107
102
108
### NetWebView2Lib (ProgId: NetWebView2.Manager)
103
109
104
-
#### ===Properties===
110
+
#### ===Properties===
105
111
106
112
##### AreDevToolsEnabled
107
113
Determines whether the user is able to use the context menu or keyboard shortcuts to open the DevTools window.
@@ -188,14 +194,18 @@ Control visibility of the browser's default error pages (e.g., connection lost).
188
194
`object.IsBuiltInErrorPageEnabled = Value`
189
195
190
196
##### BrowserWindowHandle
191
-
Returns the internal window handle (HWND) of the WebView2 control. This is the child window attached to the parent GUI.
197
+
Returns the internal window handle (HWND) of the WebView2 control. [Format: `[HANDLE:0x...]`]
192
198
`object.BrowserWindowHandle`
193
199
200
+
##### ParentWindowHandle
201
+
Returns the parent window handle provided during initialization. [Format: `[HANDLE:0x...]`]
202
+
`object.ParentWindowHandle`
203
+
194
204
##### BlockedVirtualKeys
195
205
A comma-separated list of Virtual Key codes to be blocked synchronously (e.g., "116,123").
196
206
`object.BlockedVirtualKeys = "116,123"`
197
207
198
-
#### ===Method===
208
+
#### ===Method===
199
209
200
210
##### Initialize
201
211
Initializes the WebView2 control within a parent window.
@@ -354,6 +364,7 @@ Enables or disables the Web Message communication system.
354
364
##### SetStatusBarEnabled
355
365
Enables or disables the browser status bar.
356
366
`object.SetStatusBarEnabled(Enabled As Boolean)`
367
+
357
368
358
369
##### CapturePreview
359
370
Captures a screenshot of the current view to a file.
@@ -489,7 +500,7 @@ Captures page data using Chrome DevTools Protocol. Can return MHTML or other CDP
489
500
`object.CaptureSnapshot(CdpParameters As String)`
490
501
491
502
##### SetDownloadPath
492
-
Sets a global default folder or file path for all browser downloads. If a directory is provided, the filename is automatically appended by the library.
503
+
Sets a global default folder or file path for all browser downloads. If a directory is provided, the filename is automatically appended by the library. Create the folder if it doesn't exist
493
504
`object.SetDownloadPath(Path As String)`
494
505
495
506
##### CancelDownloads
@@ -504,7 +515,7 @@ Cancels active downloads. If `uri` is empty or omitted, cancels all active downl
504
515
Captures the current page as a PDF and returns the content as a Base64-encoded string.
505
516
`object.PrintToPdfStream()`
506
517
507
-
#### ===Events===
518
+
#### ===Events===
508
519
509
520
##### OnMessageReceived
510
521
Fired when a message or notification is sent from the library to AutoIt.
@@ -564,14 +575,21 @@ Fired when an accelerator key is pressed. Allows blocking browser shortcuts.
564
575
*Args properties:
565
576
VirtualKey (uint): The VK code of the key.
566
577
KeyEventKind (int): Type of key event (Down, Up, etc.).
567
-
Handled (bool): Set to `True` to stop the browser from processing the key.*
568
-
578
+
Handled (bool): Set to `True` to stop the browser from processing the key.
579
+
RepeatCount (uint): The number of times the key has repeated.
580
+
ScanCode (uint): Hardware scan code.
581
+
IsExtendedKey (bool): True if it's an extended key (e.g., right Alt).
582
+
IsMenuKeyDown (bool): True if Alt is pressed.
583
+
WasKeyDown (bool): True if the key was already down.
584
+
IsKeyReleased (bool): True if the event is a key up.
585
+
KeyEventLParam (int): Gets the LPARAM value that accompanied the window message*
586
+
569
587
570
588
---
571
589
572
590
### JsonParser (ProgId: NetJson.Parser)
573
591
574
-
#### ===Methods===
592
+
#### ===Methods===
575
593
576
594
##### Parse
577
595
Parses a JSON string. Automatically detects if it's an Object or an Array.
ConsoleWrite($oArgs.Handled &@CRLF) ; Indicates whether the AcceleratorKeyPressed event is handled by host.
109
-
ConsoleWrite($oArgs.KeyEventKind &@CRLF) ; Gets the key event kind that caused the event to run
110
-
ConsoleWrite($oArgs.KeyEventLParam &@CRLF) ; Gets the LPARAM value that accompanied the window message.
176
+
;~ ConsoleWrite($oArgs.Handled & @CRLF) ; Indicates whether the AcceleratorKeyPressed event is handled by host.
177
+
;~ ConsoleWrite($oArgs.KeyEventKind & @CRLF) ; Gets the key event kind that caused the event to run
178
+
;~ ConsoleWrite($oArgs.KeyEventLParam & @CRLF) ; Gets the LPARAM value that accompanied the window message.
111
179
;~ ConsoleWrite('>> PhysicalKeyStatus=' & $oArgs.PhysicalKeyStatus & @CRLF) ; Gets a CoreWebView2PhysicalKeyStatus representing the information passed in the LPARAM of the window message. ==> ; https://learn.microsoft.com/en-us/dotnet/api/microsoft.web.webview2.core.corewebview2physicalkeystatus?view=webview2-dotnet-1.0.705.50
112
-
ConsoleWrite($oArgs.VirtualKey &@CRLF) ; Gets the Win32 virtual key code of the key that was pressed or released.
180
+
;~ ConsoleWrite($oArgs.VirtualKey & @CRLF) ; Gets the Win32 virtual key code of the key that was pressed or released.
181
+
182
+
;~ If $oArgs.VirtualKey = 27 Then ; ESC 27 1b 033 Escape, next character is not echoed ; https://www.autoitscript.com/autoit3/docs/appendix/ascii.htm
0 commit comments