Skip to content

Commit e5ae48a

Browse files
committed
Added SciterAPIHost.GetWindowParent
1 parent 53d3cf1 commit e5ae48a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/EmptyFlow.SciterAPI/Client/HostWindowsAPI.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,17 @@ public nint GetWindowFocus ( nint window ) {
340340
return nint.Zero;
341341
}
342342

343+
public nint GetWindowParent ( nint window ) {
344+
var script = $"Window.this.parent";
345+
if ( m_basicApi.SciterEval ( window, script, (uint) script.Length, out var result ) ) {
346+
if ( result.IsNull ) return nint.Zero;
347+
348+
return ElementFromValue ( result );
349+
}
350+
351+
return nint.Zero;
352+
}
353+
343354
public int GetWindowScreen ( nint window ) {
344355
var script = $"Window.this.screen";
345356
if ( m_basicApi.SciterEval ( window, script, (uint) script.Length, out var result ) ) {

src/EmptyFlow.SciterAPI/EmptyFlow.SciterAPI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
SciterAPIHost.ShowWindowSelectFolderDialog for show select folder dialog
2626
SciterAPIHost.GetWindowFocus get focus element in window
2727
SciterAPIHost.GetWindowScreen get window current screen
28+
SciterAPIHost.GetWindowParent get window parent pointer
2829
</PackageReleaseNotes>
2930
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
3031
</PropertyGroup>

0 commit comments

Comments
 (0)