Repository navigation
Simple Launcher v2.16
Bug fixes
- Icons on buttons below a duplicated entry were silently dropped; the shift loop in IDM_DUPLICATE_BTN now carries g_icons[i-1] forward correctly.
- The separator and category branches in IDC_OK now explicitly zero launchMode, preventing a stale value from leaking if the slot previously held a normal button.
- SwitchProfile now cancels any in-flight drag and releases mouse capture before tearing down the old layout, preventing a phantom BN_CLICKED from firing on the new profile's buttons.
- The freed tail slot after a delete is now memset to zero, so no stale isSeparator, isCategory, or other fields linger beyond g_count.
Security
- WriteEscaped now also strips ] in addition to \r, \n, and [, fully closing the section-header injection vector for INI readers that treat an unmatched bracket as a section boundary.
- A comment was added at the ShellExecute call site noting that the "open" verb accepts script types (.bat, .ps1, .vbs, etc.) and that the INI should be stored in a user-controlled location only.
Optimizations
- CreatePen/DeleteObject inside DrawDropLine (called twice per WM_MOUSEMOVE during drag) is replaced with a cached g_hpenDragLine managed alongside the other GDI objects in EnsureDarkGDI/FreeDarkGDI.
- Three speculative EnsureDarkGDI calls inside DrawButton were removed; ApplyDarkBackground now calls EnsureDarkGDI unconditionally so light-mode pens and category brushes are always ready before any paint occurs.
- Two cursor handles (g_curArrow, g_curSizeNS) are loaded once at startup and reused in WM_MOUSEMOVE, WM_LBUTTONUP, and WM_CAPTURECHANGED instead of calling LoadCursor on every message.
- InitCommonControls was replaced with InitCommonControlsEx using ICC_STANDARD_CLASSES | ICC_BAR_CLASSES, which is the correct forward-compatible call and avoids linker warnings on modern SDKs.