{"_id":"@bun-win32/comdlg32","_rev":"4-5ff0729a615f69199df0b605043bb03e","name":"@bun-win32/comdlg32","dist-tags":{"latest":"2.0.1"},"versions":{"1.0.0":{"name":"@bun-win32/comdlg32","version":"1.0.0","keywords":["bun","ffi","win32","windows","comdlg32","bindings","typescript","dll"],"author":"Stev Peifer <stev@bell.net>","license":"MIT","_id":"@bun-win32/comdlg32@1.0.0","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"4b1fd134a087e91b296754f788f8061268368b62","tarball":"https://registry.npmjs.org/@bun-win32/comdlg32/-/comdlg32-1.0.0.tgz","fileCount":6,"integrity":"sha512-0eOxYMytQpshvbBRBOnGYaGucy8Kx03Xfe+UxeXJWGeveQybT/iUbGlln6Nsbvm3mGE29LQP9AWMYW5J7Up8aw==","signatures":[{"sig":"MEYCIQD85tqF7EGXKGr1LyXRVXQkNhsq4TOrK5wPN+7spMb5pwIhAJCgx1TxzRjPISK5GYdb6qWi7UQBOgRSN6b/FFjiLXrq","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22044},"main":"./index.ts","type":"module","module":"index.ts","shasum":"4b1fd134a087e91b296754f788f8061268368b62","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:palette-painter":"bun ./example/palette-painter.ts","example:file-dialog-diagnostic":"bun ./example/file-dialog-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-0eOxYMytQpshvbBRBOnGYaGucy8Kx03Xfe+UxeXJWGeveQybT/iUbGlln6Nsbvm3mGE29LQP9AWMYW5J7Up8aw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/comdlg32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMDLG32 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.2"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/user32":"3.0.20","@bun-win32/kernel32":"1.0.21"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/comdlg32_1.0.0_1778689643156_0.171796962715818","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@bun-win32/comdlg32","version":"1.0.1","keywords":["bun","ffi","win32","windows","comdlg32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/comdlg32@1.0.1","maintainers":[{"name":"obscuritysrl","email":"stev@bell.net"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"d7f2208cf1d73f064a2029c7dc182bfeb2879868","tarball":"https://registry.npmjs.org/@bun-win32/comdlg32/-/comdlg32-1.0.1.tgz","fileCount":6,"integrity":"sha512-1XzWGjoXdBm+IOFTVBVJ01NrXl8VXH0zVXvYbcQVfryEMwwRstkP1JkIPeBLRPrws6rFOqAsmenUDDkh1ghlGQ==","signatures":[{"sig":"MEQCIGF1LtaCK+cnBAhvXek73rB5SOz4GfLwQQu3Mch+1rT5AiBsiPtSswkWKFsDUTwsIrMl56/EKd9AKDSwCNpbe+EZUg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22049},"main":"./index.ts","type":"module","module":"index.ts","shasum":"d7f2208cf1d73f064a2029c7dc182bfeb2879868","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:palette-painter":"bun ./example/palette-painter.ts","example:file-dialog-diagnostic":"bun ./example/file-dialog-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev@bell.net"},"_integrity":"sha512-1XzWGjoXdBm+IOFTVBVJ01NrXl8VXH0zVXvYbcQVfryEMwwRstkP1JkIPeBLRPrws6rFOqAsmenUDDkh1ghlGQ==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/comdlg32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMDLG32 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"24.3.0","dependencies":{"@bun-win32/core":"1.1.4"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/user32":"3.0.22","@bun-win32/kernel32":"1.0.26"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/comdlg32_1.0.1_1781130802405_0.17724876339151607","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@bun-win32/comdlg32","version":"2.0.0","keywords":["bun","ffi","win32","windows","comdlg32","bindings","typescript","dll"],"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","_id":"@bun-win32/comdlg32@2.0.0","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dist":{"shasum":"37017d072821e5ee21b7e64dd7de24268832aabb","tarball":"https://registry.npmjs.org/@bun-win32/comdlg32/-/comdlg32-2.0.0.tgz","fileCount":6,"integrity":"sha512-FOp2KGtCrU4wV9yL49FwV7DJJjYu7cjsBfa7dBpMpf0RSDNgpQOuqPfndx/w+fVEG32OhPC4gAaRA9+NkdngQw==","signatures":[{"sig":"MEYCIQDqCCfUyjuxekkpdehDhNsw2jtIRETnHgPcZ7HUe1NC5AIhAIBvDY6W8J9JDw4G7GDGjQbk+fljfuirT956kesRQ00R","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":23570},"main":"./index.ts","type":"module","module":"index.ts","shasum":"37017d072821e5ee21b7e64dd7de24268832aabb","engines":{"bun":">=1.1.0"},"exports":{".":"./index.ts"},"private":false,"scripts":{"example:palette-painter":"bun ./example/palette-painter.ts","example:file-dialog-diagnostic":"bun ./example/file-dialog-diagnostic.ts"},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"_integrity":"sha512-FOp2KGtCrU4wV9yL49FwV7DJJjYu7cjsBfa7dBpMpf0RSDNgpQOuqPfndx/w+fVEG32OhPC4gAaRA9+NkdngQw==","repository":{"url":"git://github.com/ObscuritySRL/bun-win32.git","type":"git","directory":"packages/comdlg32"},"_npmVersion":"10.8.3","description":"Zero-dependency, zero-overhead Win32 COMDLG32 bindings for Bun (FFI) on Windows.","directories":{},"sideEffects":false,"_nodeVersion":"26.3.0","dependencies":{"@bun-win32/core":"2.0.0"},"_hasShrinkwrap":false,"devDependencies":{"@types/bun":"latest","@bun-win32/user32":"4.0.0","@bun-win32/kernel32":"2.0.0"},"peerDependencies":{"typescript":"^5"},"_npmOperationalInternal":{"tmp":"tmp/comdlg32_2.0.0_1782435282385_0.893796898780548","host":"s3://npm-registry-packages-npm-production"}},"2.0.1":{"author":"Stev Peifer <stev.p@outlook.com>","bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"dependencies":{"@bun-win32/core":"2.0.1"},"description":"Zero-dependency, zero-overhead Win32 COMDLG32 bindings for Bun (FFI) on Windows.","devDependencies":{"@bun-win32/kernel32":"2.0.1","@bun-win32/user32":"4.0.1","@types/bun":"latest"},"exports":{".":"./index.ts"},"license":"MIT","module":"index.ts","name":"@bun-win32/comdlg32","peerDependencies":{"typescript":"^5"},"private":false,"homepage":"https://github.com/ObscuritySRL/bun-win32#readme","repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/comdlg32"},"type":"module","version":"2.0.1","main":"./index.ts","keywords":["bun","ffi","win32","windows","comdlg32","bindings","typescript","dll"],"sideEffects":false,"engines":{"bun":">=1.1.0"},"scripts":{"example:file-dialog-diagnostic":"bun ./example/file-dialog-diagnostic.ts","example:palette-painter":"bun ./example/palette-painter.ts"},"_id":"@bun-win32/comdlg32@2.0.1","_integrity":"sha512-d8IuklPk4FP/6N+Ve5hJCj242nDphu7doW9csdhwWNbuFit1ghckMFmvCPovJsghL2l18ZjbXlfHHhOwDLQLnA==","_nodeVersion":"26.3.0","_npmVersion":"10.8.3","shasum":"df269fc550d19b01b18acb497f21e838c85e7d9f","dist":{"integrity":"sha512-d8IuklPk4FP/6N+Ve5hJCj242nDphu7doW9csdhwWNbuFit1ghckMFmvCPovJsghL2l18ZjbXlfHHhOwDLQLnA==","shasum":"df269fc550d19b01b18acb497f21e838c85e7d9f","tarball":"https://registry.npmjs.org/@bun-win32/comdlg32/-/comdlg32-2.0.1.tgz","fileCount":6,"unpackedSize":23570,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIE3KgDygcFnCNLB42Nhl/4PmrGJBzIskd0sH7twMODNjAiAztwgUx8CkyPmC4MF9lIvpWUyv+YieWnEHWPsreIv2FQ=="}]},"_npmUser":{"name":"obscuritysrl","email":"stev.p@outlook.com"},"directories":{},"maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/comdlg32_2.0.1_1782437740403_0.4794134420919465"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-13T16:27:23.035Z","modified":"2026-06-26T01:35:40.633Z","1.0.0":"2026-05-13T16:27:23.309Z","1.0.1":"2026-06-10T22:33:22.529Z","2.0.0":"2026-06-26T00:54:42.524Z","2.0.1":"2026-06-26T01:35:40.525Z"},"bugs":{"url":"https://github.com/ObscuritySRL/bun-win32/issues"},"author":"Stev Peifer <stev.p@outlook.com>","license":"MIT","homepage":"https://github.com/ObscuritySRL/bun-win32#readme","keywords":["bun","ffi","win32","windows","comdlg32","bindings","typescript","dll"],"repository":{"type":"git","url":"git://github.com/ObscuritySRL/bun-win32.git","directory":"packages/comdlg32"},"description":"Zero-dependency, zero-overhead Win32 COMDLG32 bindings for Bun (FFI) on Windows.","maintainers":[{"name":"obscuritysrl","email":"stev.p@outlook.com"}],"readme":"# @bun-win32/comdlg32\n\nZero-dependency, zero-overhead Win32 Comdlg32 bindings for [Bun](https://bun.sh) on Windows.\n\n## Overview\n\n`@bun-win32/comdlg32` exposes the `comdlg32.dll` exports using [Bun](https://bun.sh)'s FFI. It provides a single class, `Comdlg32`, which lazily binds native symbols on first use. You can optionally preload a subset or all symbols up-front via `Preload()`.\n\nThe bindings are strongly typed for a smooth DX in TypeScript.\n\n## Features\n\n- [Bun](https://bun.sh)-first ergonomics on Windows 10/11.\n- Direct FFI to `comdlg32.dll` (native Open/Save file dialogs, Color picker, Font picker, Print dialog, Page Setup, Find/Replace, and last-error reporting).\n- In-source docs in `structs/Comdlg32.ts` with links to Microsoft Docs.\n- Lazy binding on first call; optional eager preload (`Comdlg32.Preload()`).\n- No wrapper overhead; calls map 1:1 to native APIs.\n- Strongly-typed Win32 aliases (see `types/Comdlg32.ts`).\n\n## Requirements\n\n- [Bun](https://bun.sh) runtime\n- Windows 10 or later\n\n## Installation\n\n```sh\nbun add @bun-win32/comdlg32\n```\n\n## Quick Start\n\n```ts\nimport Comdlg32, { OpenFileNameFlag } from '@bun-win32/comdlg32';\n\n// Build an OPENFILENAMEW struct (152 bytes on x64) for GetOpenFileNameW\nconst OPENFILENAMEW_SIZE = 152;\nconst ofn = Buffer.alloc(OPENFILENAMEW_SIZE);\nconst view = new DataView(ofn.buffer);\n\n// Filter: pipe-separated label/pattern pairs, NUL-terminated, double-NUL at end\nconst filter = Buffer.from('All Files (*.*)\\0*.*\\0\\0', 'utf16le');\n\n// Output buffer for the chosen path (260 wide chars)\nconst fileBuf = Buffer.alloc(260 * 2);\n\nview.setUint32(0x00, OPENFILENAMEW_SIZE, true);            // lStructSize\nview.setBigUint64(0x18, BigInt(filter.ptr!), true);        // lpstrFilter\nview.setBigUint64(0x30, BigInt(fileBuf.ptr!), true);       // lpstrFile\nview.setUint32(0x38, 260, true);                           // nMaxFile\nview.setUint32(0x60, OpenFileNameFlag.OFN_EXPLORER | OpenFileNameFlag.OFN_FILEMUSTEXIST, true);\n\nif (Comdlg32.GetOpenFileNameW(ofn.ptr!)) {\n  const path = fileBuf.toString('utf16le').replace(/\\0.*$/, '');\n  console.log('Selected:', path);\n} else {\n  console.log('Cancelled. Error code:', Comdlg32.CommDlgExtendedError());\n}\n```\n\n> [!NOTE]\n> AI agents: see `AI.md` for the package binding contract and source-navigation guidance. It explains how to use the package without scanning the entire implementation.\n\n## Examples\n\nRun the included examples:\n\n```sh\nbun run example:palette-painter        # Interactive color picker — build a palette of colors\nbun run example:file-dialog-diagnostic # Open file dialog with full OPENFILENAMEW field dump\n```\n\n## Notes\n\n- Either rely on lazy binding or call `Comdlg32.Preload()`.\n- All `A`/`W` pairs are bound; prefer the `W` (Unicode) variants for modern code.\n- The common dialog APIs are interactive — they display modal windows. Use `CommDlgExtendedError()` to inspect failure codes after a `FALSE`/`0` return.\n- Windows only. Bun runtime required.\n- **SAL types & naming:** nullability is in the **type** — `Optional<T>` (formally optional, SAL `_*opt_`) and `Nullable<T>` (plain `[in]`/`[out]` the docs say can be NULL), the null sentinel derived from `T` (`null` for pointers `LP*`/`P*`, `0n` for handles/by-value addresses); direction is in the **parameter name** — `_out` (`_Out_`), `_in_out` (`_Inout_`), `_In_` bare. See `AI.md` and the repo `AGENTS.md`.\n","readmeFilename":"README.md"}