Fixing my BF1942 woes with Win32 APIs

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • SRWE

    Simple Runtime Window Editor

  • //A snippet of the code that helped me with the Win32 APIs from the Simple Runtime Window Editor (SRWE) //Source: https://github.com/dtgDTGdtg/SRWE/blob/b439859e15ca44b6c4715fdb015c321a49ef634a/SRWE/Window.cs public void RemoveBorders() { uint nStyle = (uint)WinAPI.GetWindowLong(m_hWnd, WinAPI.GWL_STYLE); nStyle = (nStyle | (WinAPI.WS_THICKFRAME + WinAPI.WS_DLGFRAME + WinAPI.WS_BORDER)) ^ (WinAPI.WS_THICKFRAME + WinAPI.WS_DLGFRAME + WinAPI.WS_BORDER); WinAPI.SetWindowLong(m_hWnd, WinAPI.GWL_STYLE, nStyle); nStyle = (uint)WinAPI.GetWindowLong(m_hWnd, WinAPI.GWL_EXSTYLE); nStyle = (nStyle | (WinAPI.WS_EX_DLGMODALFRAME + WinAPI.WS_EX_WINDOWEDGE + WinAPI.WS_EX_CLIENTEDGE + WinAPI.WS_EX_STATICEDGE)) ^ (WinAPI.WS_EX_DLGMODALFRAME + WinAPI.WS_EX_WINDOWEDGE + WinAPI.WS_EX_CLIENTEDGE + WinAPI.WS_EX_STATICEDGE); WinAPI.SetWindowLong(m_hWnd, WinAPI.GWL_EXSTYLE, nStyle); uint uFlags = WinAPI.SWP_NOSIZE | WinAPI.SWP_NOMOVE | WinAPI.SWP_NOZORDER | WinAPI.SWP_NOACTIVATE | WinAPI.SWP_NOOWNERZORDER | WinAPI.SWP_NOSENDCHANGING | WinAPI.SWP_FRAMECHANGED; WinAPI.SetWindowPos(m_hWnd, 0, 0, 0, 0, 0, uFlags); }

  • terrafx.interop.windows

    Interop bindings for Windows.

  • I tried out both TerraFX.Interop.Windows and CsWin32, ultimately settling on the latter. CsWin32 was a little less intimidating as the API is generated based on strings in a text file rather than containing everything at once. Also I like jumping to definition of types to read more and explore APIs etc and doing that to one of the types in the TerraFX library crashed Visual Studio. That's more of a VS problem than a TerraFX library but still - CsWin32 would work great for what I'm doing.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • CsWin32

    A source generator to add a user-defined set of Win32 P/Invoke methods and supporting types to a C# project.

  • I tried out both TerraFX.Interop.Windows and CsWin32, ultimately settling on the latter. CsWin32 was a little less intimidating as the API is generated based on strings in a text file rather than containing everything at once. Also I like jumping to definition of types to read more and explore APIs etc and doing that to one of the types in the TerraFX library crashed Visual Studio. That's more of a VS problem than a TerraFX library but still - CsWin32 would work great for what I'm doing.

  • Borderless1942

    Allows Battlefield 1942 to be borderless

  • I called my project Borderless 1942 and is available on GitHub. It is a self-contained, single-file .NET 6 application. Because it is self-contained, you don't need .NET 6 installed to run it.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts