-2

so im currently making an custom rendered but I cannot understand how to make a win32 window on c#. I need one because its more optimized, way less messier and suports DirectX accelerated rendering than winforms and wpf.

What i already tried:

  • Searching on google, no valid/useful anwsers for the problem thought.

Thank you for your time, ItsRedly

DALVES2012
  • 27
  • 5
  • You can use a library such as SlimDX if you want DirectX support for C#. – PMF Nov 01 '22 at 20:05
  • 1
    With Windows Forms being pretty much a managed interface over native `HWND`'s it's rather inconclusive to want native `HWND`'s but not Windows Forms. You seem to have misidentified the problem you wish to solve. – IInspectable Nov 01 '22 at 20:23
  • This open source project here https://github.com/aelyo-softworks/Wice does that (no dependency on WPF, on Winforms only for diagnostics, uses Direct Composition, DirectX, Direct2D), creating code is here https://github.com/aelyo-softworks/Wice/blob/main/Wice/Window.cs#L1767 with all interop definitions, but what you want to do is nothing but a quick & dirty task. If you want DirectX + Win32 + C#, the most simple and official way is to head for WinUI3 https://learn.microsoft.com/en-us/windows/apps/winui/winui3/ – Simon Mourier Nov 02 '22 at 08:45

1 Answers1

2

Look it up on msdn (https://learn.microsoft.com/en-us/windows/win32/learnwin32/your-first-windows-program), then pinvoke all the functions.