Skip to content

Commit 0ca344f

Browse files
committed
add readme
1 parent 1e2d1eb commit 0ca344f

File tree

2 files changed

+131
-0
lines changed

2 files changed

+131
-0
lines changed
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Build and Release DLLs
2+
3+
on:
4+
# 手动触发或在创建新 tag 时自动发布
5+
push:
6+
branches:
7+
- '**'
8+
tags:
9+
- '**'
10+
workflow_dispatch:
11+
12+
jobs:
13+
build-windows:
14+
name: Build on ${{ matrix.config.name }}
15+
runs-on: windows-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
config:
20+
- name: MSVC x86
21+
arch: x86
22+
compiler: msvc
23+
artifact-name: getselected-x86.dll
24+
- name: MSVC x64
25+
arch: x64
26+
compiler: msvc
27+
artifact-name: getselected-x64.dll
28+
- name: MSYS2 UCRT64
29+
arch: ucrt64
30+
compiler: msys2
31+
artifact-name: getselected-ucrt64.dll
32+
33+
steps:
34+
- name: Checkout code
35+
uses: actions/checkout@v4
36+
37+
- name: Setup MSVC (for MSVC builds)
38+
if: matrix.config.compiler == 'msvc'
39+
uses: ilammy/msvc-dev-cmd@v1
40+
with:
41+
arch: ${{ matrix.config.arch }}
42+
43+
- name: Setup MSYS2 (for MSYS2 builds)
44+
if: matrix.config.compiler == 'msys2'
45+
uses: msys2/setup-msys2@v2
46+
with:
47+
msystem: UCRT64
48+
install: git mingw-w64-${{ matrix.config.arch }}-toolchain base-devel binutils
49+
50+
- name: Build with MSVC
51+
if: matrix.config.compiler == 'msvc'
52+
run: cd src && .\build.bat
53+
shell: cmd
54+
55+
- name: Build with MSYS2
56+
if: matrix.config.compiler == 'msys2'
57+
run: |
58+
cd src
59+
ming32-make
60+
shell: msys2 {0}
61+
62+
- name: Locate and rename DLL
63+
id: find-dll
64+
run: |
65+
$dll = Get-ChildItem -Path . -Recurse -Include "*.dll" | Select-Object -First 1
66+
if (-not $dll) {
67+
Write-Error "No DLL found after build!"
68+
exit 1
69+
}
70+
Copy-Item $dll.FullName -Destination "${{ matrix.config.artifact-name }}"
71+
echo "dll_path=${{ matrix.config.artifact-name }}" >> $env:GITHUB_OUTPUT
72+
shell: pwsh
73+
74+
- name: Upload artifact
75+
uses: actions/upload-artifact@v4
76+
with:
77+
name: ${{ matrix.config.artifact-name }}
78+
path: ${{ steps.find-dll.outputs.dll_path }}
79+
80+
release:
81+
name: Create Release
82+
needs: build-windows
83+
runs-on: ubuntu-latest
84+
if: github.ref_type == 'tag' && startsWith(github.ref_name, 'v')
85+
steps:
86+
- name: Download all artifacts
87+
uses: actions/download-artifact@v4
88+
with:
89+
path: release-assets
90+
91+
- name: Flatten directory structure
92+
run: |
93+
mkdir -p release
94+
find release-assets -type f -name "*.dll" -exec mv {} release/ \;
95+
96+
- name: Create Release
97+
uses: softprops/action-gh-release@v2
98+
with:
99+
files: release/*.dll
100+
prerelease: false
101+
draft: false
102+
fail_on_unmatched_files: true

readme.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## Overview
2+
3+
This project is a Windows DLL library that enables multithreadd file and folder selection dialogs with support for unlimited file selections.
4+
5+
The library solves the limitations of the standard Windows `GetOpenFileNameW` or `IFileOpenDialog ` API, which restricts simultaneous multi-selection of both files and folders(click Ok not close and return when selection mixed with folder) and multi-select results to a fixed-size buffer (lpstrFile).
6+
7+
## Usage
8+
9+
### How to use
10+
1. Import `src/GetSelected.c` and `GetSelected.h` to your project.
11+
2. Decalre points to store your selected path.
12+
13+
see example `src/test_multithread-static.c`.
14+
15+
### Example
16+
17+
#### Use Windows `cl.exe`
18+
19+
```bat
20+
cd src
21+
.\build.bat
22+
```
23+
24+
#### Use MINGW `make`
25+
26+
```sh
27+
cd src
28+
make
29+
```

0 commit comments

Comments
 (0)