Skip to content

Instantly share code, notes, and snippets.

View Mrgaton's full-sized avatar
:shipit:
Squirl

Mrgaton

:shipit:
Squirl
  • Cocodrila company
  • Narnia
  • 03:46 (UTC +01:00)
View GitHub Profile
@gotmachine
gotmachine / OpenFileDialog
Created October 28, 2020 07:20
P/Invoke OpenFileDialog (no dependency on System.Windows.Forms)
public class OpenFileDialog
{
[DllImport("comdlg32.dll", SetLastError = true, CharSet = CharSet.Auto)]
private static extern bool GetOpenFileName([In, Out] OpenFileName ofn);
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
private class OpenFileName
{
public int structSize = 0;
public IntPtr dlgOwner = IntPtr.Zero;