Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 31 additions & 35 deletions src/windy/platforms/win32/windefs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,30 @@ type
BITMAPINFO* {.pure.} = object
bmiHeader*: BITMAPINFOHEADER
bmiColors*: array[1, RGBQUAD]
OPENFILENAMEW* {.pure.} = object
lStructSize*: DWORD
hwndOwner*: HWND
hInstance*: HINSTANCE
lpstrFilter*: LPCWSTR
lpstrCustomFilter*: LPWSTR
nMaxCustFilter*: DWORD
nFilterIndex*: DWORD
lpstrFile*: LPWSTR
nMaxFile*: DWORD
lpstrFileTitle*: LPWSTR
nMaxFileTitle*: DWORD
lpstrInitialDir*: LPCWSTR
lpstrTitle*: LPCWSTR
Flags*: DWORD
nFileOffset*: WORD
nFileExtension*: WORD
lpstrDefExt*: LPCWSTR
lCustData*: LPARAM
lpfnHook*: pointer
lpTemplateName*: LPCWSTR
pvReserved*: pointer
dwReserved*: DWORD
FlagsEx*: DWORD

type
wglCreateContext* = proc(hdc: HDC): HGLRC {.stdcall, raises: [].}
Expand Down Expand Up @@ -565,6 +589,11 @@ const
DIB_RGB_COLORS* = 0
SRCCOPY* = 0x00CC0020
GDI_ERROR* = -1
OFN_OVERWRITEPROMPT* = 0x00000002.DWORD
OFN_NOCHANGEDIR* = 0x00000008.DWORD
OFN_PATHMUSTEXIST* = 0x00000800.DWORD
OFN_FILEMUSTEXIST* = 0x00001000.DWORD
OFN_EXPLORER* = 0x00080000.DWORD

{.push importc, stdcall.}

Expand Down Expand Up @@ -1156,45 +1185,12 @@ proc CloseHandle*(
hObject: HANDLE
): BOOL {.dynlib: "kernel32".}

type
OPENFILENAMEW* {.pure.} = object
lStructSize*: DWORD
hwndOwner*: HWND
hInstance*: HINSTANCE
lpstrFilter*: LPCWSTR
lpstrCustomFilter*: LPWSTR
nMaxCustFilter*: DWORD
nFilterIndex*: DWORD
lpstrFile*: LPWSTR
nMaxFile*: DWORD
lpstrFileTitle*: LPWSTR
nMaxFileTitle*: DWORD
lpstrInitialDir*: LPCWSTR
lpstrTitle*: LPCWSTR
Flags*: DWORD
nFileOffset*: WORD
nFileExtension*: WORD
lpstrDefExt*: LPCWSTR
lCustData*: LPARAM
lpfnHook*: pointer
lpTemplateName*: LPCWSTR
pvReserved*: pointer
dwReserved*: DWORD
FlagsEx*: DWORD

const
OFN_OVERWRITEPROMPT* = 0x00000002.DWORD
OFN_NOCHANGEDIR* = 0x00000008.DWORD
OFN_PATHMUSTEXIST* = 0x00000800.DWORD
OFN_FILEMUSTEXIST* = 0x00001000.DWORD
OFN_EXPLORER* = 0x00080000.DWORD

proc GetOpenFileNameW*(
ofn: ptr OPENFILENAMEW
): BOOL {.dynlib: "Comdlg32", importc.}
): BOOL {.dynlib: "Comdlg32".}

proc GetSaveFileNameW*(
ofn: ptr OPENFILENAMEW
): BOOL {.dynlib: "Comdlg32", importc.}
): BOOL {.dynlib: "Comdlg32".}

{.pop.}
Loading