Skip to content

Native Windows Folder picker - #13

Merged
harrypm merged 5 commits into
harrypm:mainfrom
machcnz:main
Jul 6, 2026
Merged

harrypm merged 5 commits into
harrypm:mainfrom
machcnz:main

Conversation

@machcnz

@machcnz machcnz commented Jul 6, 2026

Copy link
Copy Markdown

PS/Cmd shell file picker would intermittently not work. This pull request switches to native Win32 file/folder picker.

Changes:

  1. meson.build: ln 368: gui_ldflags += ['-lmf', '-lmfplat', '-lmfuuid', '-lmfreadwrite', '-lole32', '-lavrt', '-lksuser', '-luuid', '-lshell32']
  2. gui_settings.c
    #else
    #include <direct.h>
    #define COBJMACROS
    #define INITGUID
    #define Rectangle Win32_Rectangle
    #define CloseWindow Win32_CloseWindow
    #define ShowCursor Win32_ShowCursor
    #include <shlobj.h>
    #include <shobjidl.h>
    #undef ShowCursor
    #undef CloseWindow
    #undef Rectangle
    #endif

  1. gui_settings.c replace ps file picker:
    #elif defined(_WIN32) || defined(_WIN64)
    // Native Win32 file picker - no PowerShell, no console required
    OPENFILENAMEA ofn = {0};
    ofn.lStructSize = sizeof(ofn);
    ofn.lpstrFilter = "FLAC files\0*.flac\0All files\0*.*\0";
    ofn.lpstrFile = picked;
    ofn.nMaxFile = sizeof(picked);
    ofn.lpstrTitle = "Select FLAC playback file";
    ofn.Flags = OFN_FILEMUSTEXIST | OFN_PATHMUSTEXIST;
    GetOpenFileNameA(&ofn);
    trim_newlines(picked);

@harrypm
harrypm merged commit f751b1a into harrypm:main Jul 6, 2026
12 checks passed
@harrypm harrypm added the enhancement New feature or request label Jul 6, 2026
@harrypm harrypm self-assigned this Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants