Skip to content

Commit

Permalink
Fixed #428
Browse files Browse the repository at this point in the history
  • Loading branch information
dahall committed Oct 17, 2023
1 parent b9bc3bc commit 874d897
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions PInvoke/User32/WinUser.System.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3717,8 +3717,7 @@ public enum TKF : uint
// https://docs.microsoft.com/en-us/windows/desktop/dlgbox/mb-getstring LPCWSTR WINAPI MB_GetString( UINT wBtn );
[DllImport(Lib.User32, SetLastError = false, ExactSpelling = true)]
[PInvokeData("", MSDNShortId = "D2AF238D-F5A8-477D-BF47-0F5D4D68B27E")]
[return: MarshalAs(UnmanagedType.LPWStr)]
public static extern string? MB_GetString(uint wBtn);
public static extern StrPtrUni MB_GetString(uint wBtn);

/// <summary>
/// <para>Plays a waveform sound. The waveform sound for each sound type is identified by an entry in the registry.</para>
Expand Down
7 changes: 7 additions & 0 deletions UnitTests/PInvoke/User32/User32Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ bool meth(HWND hwnd, uint uMsg, IntPtr wParam, IntPtr lParam, out IntPtr lReturn
[Test()]
public void LockWorkStationTest() => throw new NotImplementedException();

[Test()]
public void MB_GetStringTest()
{
Assert.NotNull((string?)MB_GetString(1));
TestContext.WriteLine((string?)MB_GetString(1));
}

[Test()]
public void RealGetWindowClassTest() => throw new NotImplementedException();

Expand Down

0 comments on commit 874d897

Please sign in to comment.