Skip to content

Commit d014e93

Browse files
gitissue-#3382 missing using directive (#1961)
1 parent c41c181 commit d014e93

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

hub/apps/winui/winui3/desktop-winui3-app-with-basic-interop.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ The following code shows the MainWindow.xaml file from the initial template app,
9696

9797
:::code language="xaml" source="samples/WinUI-3-basic-win32-interop/WinUI-3-basic-win32-interop/MainWindow.xaml" range="10-19":::
9898

99-
1. In the MainWindow.xaml.cs code-behind file, we replace the `MyButton_Click` event handler with the following code.
99+
1. In the MainWindow.xaml.cs code-behind file, add the `using static PInvoke.User32;` directive.
100+
1. We then replace the `MyButton_Click` event handler with the following code.
100101

101102
Here, we get a reference to the current process by calling [GetCurrentProcess](/dotnet/api/system.diagnostics.process.getcurrentprocess). We then iterate through the collection of [Modules](/dotnet/api/system.diagnostics.process.modules) and append the filename of each [ProcessModule](/dotnet/api/system.diagnostics.processmodule) to our display string.
102103

0 commit comments

Comments
 (0)