-
Notifications
You must be signed in to change notification settings - Fork 0
File Reference
Descriptions of every source file, key data structures, and important functions.
Central header included by every .c file. Contains:
- All
#includedirectives for Win32 headers - All struct definitions (
AppState,Settings,Script,ScriptFolder,ExtraRepo,LocalDir,ScriptMeta,SyncResult) - All function prototypes
- Layout constants (
TOOLBAR_H,TAB_H,STATUS_Hetc.) - Colour
#definepairs (dark/light) - Runtime colour accessor inline functions (
COL_BG(),COL_TEXT()etc.) - Inline helpers (
PostStatus(),Util_Log(),Util_SnakeToTitle())
Entry point and main window procedure.
-
wWinMain— app startup: loads settings, creates window, starts sync and update threads, runs message loop -
MainWndProc— handlesWM_PAINT,WM_SIZE,WM_COMMAND,WM_DRAWITEM,WM_SETTINGCHANGE,WM_TRAYICON,WM_SYNC_DONE,WM_UPDATE_AVAIL,WM_SCRIPT_STARTED,WM_SCRIPT_STOPPED,WM_CLOSE,WM_DESTROY -
Handle_Command— routes allWM_COMMANDmessages to appropriate actions -
Handle_SyncDone— called on main thread when sync completes; rebuilds tabs -
App_InitGDI/App_FreeGDI/App_RebuildGDI— create/destroy/recreate all GDI resources -
App_BuildAppDataPath— buildsg.appdata_dirfrom%APPDATA%\CatiaMenuWin32and creates the directory if it does not exist -
App_ResolveTheme— setsg.dark_modebased oncfg.themeand Windows registry
All #define IDs for menus, dialogs, and controls. Grouped by:
- Icon:
IDI_APP_ICON - Menu:
IDR_MAINMENU,IDM_* - Dialogs:
IDD_SETTINGS,IDD_ABOUT,IDD_SOURCES,IDD_REPO_EDIT - Controls:
IDC_* - Script buttons:
IDC_SCRIPT_BTN_BASE = 1000(script index added to base)
Window creation, tab bar, tray icon, and popup menu.
-
Window_Create— registers all window classes, creates main window and all child controls including the ■しかく Stop button (IDC_BTN_STOP = 508, initiallyWS_DISABLED) -
Window_OnSize— repositions tab bar, scroll panel, and status bar on resize -
Window_ApplyDarkMode— callsDwmSetWindowAttributefor title bar dark mode -
Window_ApplyAlwaysOnTop— callsSetWindowPoswithHWND_TOPMOST/HWND_NOTOPMOST -
Window_ShowMenu— builds and shows the hamburger popup menu viaTrackPopupMenu -
Window_AddTrayIcon/Window_RemoveTrayIcon— manageNOTIFYICONDATA -
Window_ShowTrayMenu— builds and shows the right-click context menu for the system tray icon -
Window_ApplyThemeToChildren— resets the status bar visual style and invalidates the tab bar, status bar, and all child windows after a theme change -
Window_OpenExeFolder— opens the folder containing the running.exein Windows Explorer viaShellExecute -
Window_ApplyDarkMenu— placeholder for future dark-mode popup menu colouring (currently a no-op) -
TabBarProc— fully custom tab barWndProc; draws tabs at natural text width, handles scroll arrows and mouse wheel -
TabBar_NaturalWidth— measures tab label width withGetTextExtentPoint32W -
TabBar_NeedsArrows— returns true when total tab width exceeds bar width -
StatusBarProc— custom owner-drawn status barWndProc
Tab switching and script button management.
-
Tabs_Build— triggers tab bar repaint (tab bar readsg.folders[]directly) -
Tabs_Switch— setsg.active_tabandg.active_folder_name, repaints tab bar, callsTabs_RebuildButtons -
Tabs_RebuildButtons— destroys existing script buttons and creates new ones for active tab; skips hidden and filtered-out scripts -
Tabs_DestroyButtons— removes allIDC_SCRIPT_BTN_BASE+nchild windows -
Tabs_ApplyFilter— rebuilds the button grid for the active tab showing only scripts matchingg.filter_text; delegates toTabs_RebuildButtons -
Tabs_ScriptMatchesFilter— returns true if the script's name or purpose containsg.filter_text(case-insensitive); always returns true when filter is empty -
Tabs_ApplySort— sortsfolder.scripts[]in-place viaqsortusing the activeSortMode;SORT_ORDERis a no-op -
Tabs_FolderHasVisible— returns true if the folder contains at least one non-hidden script; used to suppress empty tabs -
ScrollPanelProc— scroll panelWndProc; handlesWM_VSCROLL,WM_MOUSEWHEEL,WM_DRAWITEMfor script buttons
All GDI rendering. Every function uses double-buffering (memory DC + BitBlt).
-
Paint_MainWindow— draws toolbar background, title, version, syncing indicator, update badge -
Paint_ToolbarButton— owner-draw forBS_OWNERDRAWtoolbar buttons (Menu, Refresh, Settings, Deps, Stop); handlesODS_DISABLEDstate (greyed) and applies red accent colours (COL_STOP_ACTIVE,COL_STOP_HOT) when the Stop button is active -
Paint_ScriptButton— draws a script button with accent bar, arrow, label, purpose text, andiinfo badge; acceptsbool repeatandbool running— priority: repeat (amber) > running (green) > hot (blue) -
Paint_Tooltip— draws the script info tooltip popup -
Tip_ComputeHeight— measures tooltip height usingDT_CALCRECTwith correct font -
BtnSubclassProc— subclass proc for script buttons; handles hover,ibadge detection, tooltip show/hide, and right-click context menu actions including Open in Editor (tries shelleditverb; falls back to.txtdefault app viaAssocQueryStringWon Windows 10 where.pyhas noedithandler)
All GitHub API communication.
-
GitHub_HttpGet— opens an HTTPS connection, validates the server certificate, sends a GET request, reads the response -
GitHub_VerifyCert— checks cert subject containsgithub.com/github.ioand issuer is a known CA -
GitHub_DownloadRaw— downloads a raw file fromraw.githubusercontent.com -
GitHub_DownloadRawFull— downloads from a specified host/path (used for extra repos) -
GitHub_ComputeFileSHA1— computes Git blob SHA1 (SHA1("blob <size>0円<content>")) using Windows CryptAPI -
GitHub_VerifyScriptSHA— compares computed SHA againsts->shafrom the API -
GitHub_ParseOwnerRepo— extractsownerandrepofrom a full GitHub URL -
GitHub_ParseRoot— parses the contents API JSON to find folder entries -
GitHub_ParseFolder— parses a folder's contents JSON to find.pyscript entries
GitHub sync thread and local directory scanning.
-
Sync_Thread— background thread: fetches root, parses folders, downloads changed scripts, syncs extra repos, scans local dirs, saves manifest, postsWM_SYNC_DONE -
Sync_LoadManifest— called at startup: scanscache_diron disk to populateg.folders[]immediately without internet -
Sync_SaveManifest— writes all current SHA values tomanifest.ini -
Sync_GetLocalSHA— reads a script's SHA frommanifest.ini -
Sync_MergeFolder— adds scripts to an existing folder or creates a new one; used for merging sources -
Sync_ExtraRepo— syncs one extra GitHub repository -
Sync_LocalDir— scans a local folder, treats subfolders as tabs, skipssetup/ -
DeleteLocalScript— deletes a cached script file and removes empty parent directories
Script execution and dependency management.
-
Runner_Run— finds Python, then branches ons->source: local scripts (SCRIPT_SRC_LOCAL) uses->localdirectly and skip download and SHA checks entirely; GitHub-sourced scripts run the synced cache copys->local(falling back toRunner_BuildLocalPathonly when the field is empty — building from the tab name would resolve the synthetic Favourites tab to a stale per-tab copy), with optional download and SHA verification before launch. Invalidates the previously highlighted button before overwritingg.run_fi/g.run_si(ensures only one button is green at a time), then launches script in a thread -
Runner_Thread— creates process forpython script.py(with optionalcmd /kwrapper); duplicates the process handle intog.run_processviaInterlockedExchangePointer, postsWM_SCRIPT_STARTED, waits up to 30 min, then atomically clearsg.run_processand postsWM_SCRIPT_STOPPED -
Runner_Stop— atomically claimsg.run_processviaInterlockedExchangePointer(NULL), callsTerminateProcess, closes the handle, and postsWM_SCRIPT_STOPPED -
Runner_RunWithArgs— shows the Run with Arguments dialog then callsRunner_Run; the script path is sanitised viaEscapeForCmdbefore being passed tocmd.exe /k -
EscapeForCmd— escapes^,", and%characters to prevent shell injection incmd.exe /kinvocations -
Runner_FindPython— searches PATH,cfg.python_exe, and common install locations -
Runner_UpdateDeps— upgrades pip then runspip install --upgrade -r requirements.txtfor each source sequentially -
RunPipInstall— runs one pip install command and waits for it to complete
Parses the metadata header from PyCATIA script files.
-
Meta_Parse— reads up to 200 lines of a script looking for the dashed header block; extractsScript name,Version,Author,Date,Purpose,Description -
Meta_ParseAll— callsMeta_Parseon every script ing.folders[]
Header format expected:
''' -------...------ Script name: My_Script.py Version: 1.0 Purpose: One line summary. Author: Your Name Date: DD.MM.YY Description: Full description. Continuation line. -------...------ '''
Scripts use the PyCATIA library for CATIA V5 COM automation.
In-app help window implementation.
-
Help_Show()— opens the help window (or brings it to front if already open); called from F1 and Menu → Help → Help Contents -
HelpDlgProc— modeless dialog proc; manages TreeView + RichEdit layout, resizing, and topic switching; paints the app-theme background (WM_ERASEBKGND), an accent-blue topic header strip above the RichEdit (WM_PAINT,HDR_H = 40 px, label stored ins_header_text), and aCOL_DIVIDERvertical line between panes -
Help_GetRTF— returns RTF-formatted content string for each of the 12 help topics -
Help_TopicLabel— returns the display name for each topic -
Help_LoadTopic— streams RTF content into the RichEdit control viaEM_STREAMIN
User preferences persistence and script management dialogs.
-
Prefs_IsFavourite/Prefs_SetFavourite— read/write favourite state toprefs.ini -
Prefs_IsHidden/Prefs_SetHidden— read/write hidden state -
Prefs_GetRunCount/Prefs_IncrementRunCount— track script run counts for Most Used sort -
Prefs_GetNote/Prefs_SetNote— per-script user notes -
Prefs_ApplyToFolders— stamps all scripts with their prefs after every sync -
Tabs_BuildFavourites— builds a⭐ Favouritestab at index 0 when any scripts are favourited; removes existing tab first to prevent duplicates -
ScriptDetailsDlgProc— full script details dialog with all header fields, note, favourite/hidden toggles -
RunWithArgsDlgProc— dialog to enter command line arguments before running -
ScriptNoteDlgProc— quick note edit dialog -
HiddenScriptsDlgProc— manage hidden scripts with Unhide and Unhide All
Sources dialog for managing extra repos and local folders.
-
SourcesDlgProc— dialog proc forIDD_SOURCES; manages two list views (repos and local dirs) -
RepoEditDlgProc— sub-dialog for adding/editing a GitHub repo (URL, branch, token, enabled) -
DeleteFolderRecursive— recursively deletes a directory and all its contents (used when removing a repo)
Settings persistence and dialogs.
-
Settings_Load— readssettings.iniusingGetPrivateProfileString/Int; sets defaults for missing values -
Settings_Save— writes all settings tosettings.ini -
Settings_ApplyAutorun— adds/removes the app fromHKCU\...\Runregistry key -
Settings_ClampHotkey— sanitises the Quick Bar hotkey after any INI read: drops unknown modifier bits, rejects out-of-range virtual keys, and disables the hotkey entirely when no modifier remains (a bare key registered system-wide would be swallowed in every application) -
SettingsDlgProc— dialog proc forIDD_SETTINGS; includes Reset to Defaults. The hotkey is read and validated at the top of theIDOKhandler so a rejected combination leavesg.cfguntouched -
AboutDlgProc— dialog proc forIDD_ABOUT
Checks GitHub Releases API for newer versions.
-
Updater_CheckThread— background thread: waits 3s for sync to finish, calls releases API, comparesmajor.minor.patch -
Updater_AutoUpdate— downloads the new.exedirectly via WinINet, writes a batch script to replace the binary, then postsWM_CLOSE; falls back toUpdater_PromptAndInstallon any failure -
Updater_PromptAndInstall— shows the update dialog and opens the releases page if confirmed -
IsNewer— compares remote and local versions (first 3 parts only, ignores build number) -
ParseVersion— splits"1.2.3.4"into anint[4]without locale-dependentswscanf -
ParseLatestTag— extractstag_namefrom releases API JSON
Floating Quick Launch Bar — a small always-on-top button bar that mirrors the ⭐ Favourites tab.
Public API (called from main.c and window.c):
-
QuickBar_Register— registersCMW32QuickBarandCMW32QBarTipwindow classes, creates the shared large-bold font for 2-letter button labels; must be called once duringWindow_CreatebeforeQuickBar_Create -
QuickBar_Create— creates the floating bar window (WS_POPUP | WS_BORDER) and its tooltip companion; installsSetWinEventHookcallbacks forEVENT_SYSTEM_FOREGROUNDandEVENT_SYSTEM_MINIMIZESTART/END -
QuickBar_Destroy— destroys bar and tooltip windows, unhooks both WinEvent hooks, deletes the label font -
QuickBar_Show— shows or hides the bar; respectsqbar_target_appvisibility rules (only shows when a visible target window exists) -
QuickBar_Rebuild— called after the Favourites list changes; resets scroll to 0 and callsQB_UpdateGeometryto resize the bar -
QuickBar_OnThemeChange— reappliesDwmSetWindowAttributedark mode and repaints both windows on theme change -
QuickBar_SetTopmost— sets or clearsHWND_TOPMOSTon the bar window -
QuickBar_ShowTargetDlg— opens theIDD_QBAR_TARGETdialog to set the window-title tracking substring -
QuickBar_RegisterHotkey— registers the system-wide show/hide hotkey (HOTKEY_QBAR_TOGGLE) ong.hwndviaRegisterHotKeywithMOD_NOREPEAT; always unregisters first, so it is the single entry point for both initial setup and re-registration after a settings change. Posts a status-bar warning when the combination is already owned by another application -
QuickBar_UnregisterHotkey— releases the hotkey ifg.qbar_hotkey_active; safe to call when nothing is registered -
QuickBar_HotkeyText— formats the configured combination for display (e.g.Ctrl+Alt+Q, or(none)); used by the status messages and by the "Enable Quick Bar" label in both menus
Internal key functions:
-
QuickBarProc— bar window procedure; handles drag (background = drag handle), click, hover, scroll arrows, mouse wheel, right-click context menu, andVK_ESCAPE(callsRepeat_Stop()andRunner_Stop()so Escape cancels both repeat and the running script) -
QBarTipProc— tooltip window procedure; paints script name (bold) and purpose line (small) with double-buffering -
QB_Paint— double-buffered render of bar background, scroll arrows (▲さんかく▼ / ◄►), and all 2-letter abbreviation buttons with accent bar on hover -
QB_HitTest— returns button index (≥0),HIT_ARROW_PREV/NEXT, orHIT_NONE(background/drag area) -
QB_UpdateGeometry— sizes the bar window to fit visible favourites, clamped to 4/5 of the monitor's work area; callsQB_UpdateScrollMax -
QB_CatiaState— enumerates all top-level windows viaEnumWindowsand returnsCATIA_NONE,CATIA_MINIMIZED, orCATIA_VISIBLEbased on the tracked title substring -
QB_UpdateVisibility— central dispatcher called from both WinEvent hooks; hides bar when target is absent/minimised, setsHWND_TOPMOSTwhen target gains focus
typedef enum { SORT_ORDER = 0, /* order from GitHub API / disk */ SORT_ALPHA = 1, /* alphabetical A-Z */ SORT_DATE = 2, /* by script header Date: field */ SORT_MOST_USED = 3 /* by run count descending */ } SortMode; typedef enum { THEME_SYSTEM = 0, THEME_DARK = 1, THEME_LIGHT = 2 } ThemeMode;
Communicates sync outcome from Sync_Thread to the main window via WM_SYNC_DONE. The SyncResult* is passed as wParam and freed by Handle_SyncDone.
typedef enum { SR_OK=0, SR_NO_INTERNET, SR_API_ERROR, SR_PARTIAL } SyncStatus; typedef struct { SyncStatus status; int folders_added, folders_removed; int scripts_updated, scripts_added, scripts_removed; WCHAR message[256]; } SyncResult;
typedef struct { WCHAR url[512]; WCHAR branch[64]; WCHAR token[256]; bool enabled; } ExtraRepo; typedef struct { WCHAR path[MAX_APPPATH]; bool enabled; } LocalDir;
Parsed header fields from a script file. Populated by Meta_Parse.
typedef struct { WCHAR purpose[128]; WCHAR author[64]; WCHAR version[32]; WCHAR date[32]; WCHAR description[1024]; WCHAR code[64]; /* e.g. "Python3.10.4, Pycatia 0.8.3" */ WCHAR release[32]; /* e.g. "V5R32" */ WCHAR requirements[512]; } ScriptMeta;
The single global state struct. All state lives here.
typedef struct { HWND hwnd; /* main window */ HWND hwnd_tab; /* custom tab bar (CMW32TabBar) */ HWND hwnd_scroll; /* scroll panel containing script buttons */ HWND hwnd_status; /* custom status bar (CMW32StatusBar) */ HWND hwnd_tip; /* tooltip popup */ HWND hwnd_search; /* search/filter edit box */ HWND hwnd_details; /* script details panel */ ScriptFolder folders[MAX_FOLDERS]; /* all loaded folders/tabs */ int folder_count; int active_tab; int tab_offset; /* first visible tab when scrolling */ Settings cfg; bool dark_mode; /* resolved from cfg.theme + system setting */ HFONT font_ui; /* Segoe UI 13px normal */ HFONT font_bold; /* Segoe UI 13px semibold */ HFONT font_small; /* Segoe UI 11px normal */ HBRUSH br_bg, br_toolbar, br_btn, br_btn_hot, br_accent, br_status; CRITICAL_SECTION cs_folders; /* guards g.folders[] and g.folder_count */ volatile HANDLE run_process; /* NULL when idle; set/cleared atomically via InterlockedExchangePointer */ bool syncing; int hot_btn; /* currently hovered script button ID */ int tip_btn; /* button whose tooltip is showing */ int tip_h; /* cached tooltip height */ WCHAR last_run_path[MAX_APPPATH]; WCHAR appdata_dir[MAX_APPPATH]; WCHAR latest_version[32]; /* from GitHub releases API */ WCHAR active_folder_name[MAX_NAME]; /* folder name saved by Tabs_Switch for post-sync restoration */ int scroll_y, scroll_max; bool tray_icon_added; /* Filter */ WCHAR filter_text[MAX_NAME]; /* current search/filter string */ /* Details panel */ int details_script_fi; /* folder index of shown script */ int details_script_si; /* script index of shown script */ bool details_visible; /* Quick Launch Bar */ HWND hwnd_qbar; /* floating bar window */ HWND hwnd_qbar_tip; /* bar tooltip popup */ int qbar_hot; /* hovered button index, -1 = none */ int qbar_scroll; /* current scroll offset (px) */ int qbar_scroll_max; /* maximum scroll offset */ bool qbar_dragging; int qbar_drag_ox; /* drag start: cursor offset from left */ int qbar_drag_oy; /* drag start: cursor offset from top */ int qbar_tip_idx; /* button index shown in tip, -1 = none */ bool qbar_hotkey_active; /* show/hide hotkey is currently registered */ /* Double-click repeat mode */ bool repeat_mode; /* true while a script is looping */ int repeat_fi; /* folder index of the script to repeat */ int repeat_si; /* script index of the script to repeat */ bool suppress_lbuttonup; /* suppresses extra WM_LBUTTONUP after WM_LBUTTONDBLCLK */ /* Running state (background mode only) */ bool script_running; /* true while a background script is in flight */ int run_fi; /* folder index of the running script */ int run_si; /* script index of the running script */ } AppState;
All user-configurable options. Loaded from/saved to settings.ini.
typedef struct { WCHAR python_exe[MAX_APPPATH]; WCHAR cache_dir[MAX_APPPATH]; WCHAR github_token[256]; bool auto_sync, download_before_run; bool show_console, console_keep_open, deps_keep_open; bool always_on_top, minimize_to_tray; bool start_with_windows, start_minimized; bool check_updates; bool auto_update; /* auto-download and install updates */ ThemeMode theme; /* THEME_SYSTEM=0, THEME_DARK=1, THEME_LIGHT=2 */ int refresh_interval; /* hours, 0 = disabled, default 6 */ bool main_repo_enabled; ExtraRepo extra_repos[MAX_EXTRA_REPOS]; int extra_repo_count; LocalDir local_dirs[MAX_LOCAL_DIRS]; int local_dir_count; SortMode sort_mode; /* global sort mode */ /* Quick Launch Bar */ bool qbar_enabled; bool qbar_horizontal; bool qbar_topmost_with_catia; int qbar_x, qbar_y; WCHAR qbar_target_app[MAX_NAME]; /* window-title substring; empty = no target */ WCHAR qbar_target_exe[MAX_NAME]; /* process exe name (e.g. CNEXT.exe); empty = any */ bool qbar_hotkey_enabled; /* register the show/hide hotkey at all */ UINT qbar_hotkey_mods; /* MOD_* flags (default MOD_CONTROL|MOD_ALT) */ UINT qbar_hotkey_vk; /* virtual-key code (default 'Q') */ } Settings;
One tab worth of scripts.
typedef struct { WCHAR name[MAX_NAME]; /* raw folder name e.g. "Any_Document_Scripts" */ WCHAR display[MAX_NAME]; /* formatted e.g. "Any Document Scripts" */ Script *scripts; /* heap-allocated; use Folder_Alloc / Folder_Free */ int count; int capacity; /* number of allocated slots */ bool loaded; SortMode sort_mode; } ScriptFolder;
Folder_Alloc, Folder_Free, and Folder_Push are inline helpers in main.h. Folder_Push doubles capacity automatically when count == capacity.
One script button.
typedef struct { WCHAR name[MAX_NAME]; /* display name */ WCHAR gh_path[MAX_APPPATH]; /* GitHub API path e.g. "folder/script.py" */ WCHAR sha[MAX_SHA]; /* expected blob SHA from GitHub API */ WCHAR local[MAX_APPPATH]; /* local cache path */ ScriptMeta meta; bool meta_loaded; bool is_favourite; bool is_hidden; int run_count; WCHAR note[MAX_NOTE_LEN]; } Script;
Buffer limits:
| Constant | Value | Description |
|---|---|---|
MAX_FOLDERS |
64 | Maximum number of tabs |
MAX_SCRIPTS |
1024 | Default initial capacity per folder (heap grows dynamically) |
MAX_EXTRA_REPOS |
8 | Maximum extra GitHub repos |
MAX_LOCAL_DIRS |
8 | Maximum local folders |
MAX_FAVOURITES |
256 | Maximum entries in the favourites list |
MAX_HIDDEN |
256 | Maximum entries in the hidden-scripts list |
MAX_NAME |
128 | Wide character buffer for names and filter text |
MAX_SHA |
64 | Wide character buffer for a Git blob SHA1 string |
MAX_APPPATH |
520 | Wide character buffer for file-system paths |
MAX_NOTE_LEN |
512 | Wide character buffer for per-script user notes |
HTTP_BUF_SIZE |
512 KB | HTTP response read buffer |
Layout constants:
| Constant | Value | Description |
|---|---|---|
WIN_MIN_W |
820 | Minimum window width in pixels |
WIN_MIN_H |
420 | Minimum window height in pixels |
TOOLBAR_H |
38 | Toolbar height in pixels |
TAB_H |
26 | Tab bar height in pixels |
TAB_ARROW_W |
22 | Tab scroll arrow width |
STATUS_H |
22 | Status bar height |
SEARCH_H |
26 | Search/filter box height |
BTN_H |
40 | Script button height |
INFO_BTN_W |
28 | Width of the i info badge |
STAR_BTN_W |
28 | Width of the favourite star badge |
TIP_W |
320 | Script tooltip popup width |
QBAR_BTN_SIZE |
52 | Quick bar button face square (px) |
QBAR_PAD |
4 | Margin from bar edge to buttons |
QBAR_GAP |
4 | Gap between adjacent bar buttons |
QBAR_ARROW_W |
18 | Quick bar scroll arrow click area |
QBAR_TIP_W |
240 | Quick bar tooltip popup width |
QBAR_TIP_PAD |
8 | Quick bar tooltip internal padding |
QBAR_TIP_ROW |
18 | Quick bar tooltip row height |
| Message | Value | Direction | Description |
|---|---|---|---|
WM_SYNC_DONE |
WM_USER+1 |
Thread → Main | Sync completed; wParam is heap SyncResult* (freed by handler) |
WM_STATUS_SET |
WM_USER+2 |
Thread → Main | Update status bar; lParam is heap WCHAR* (freed by handler) |
WM_TRAYICON |
WM_USER+10 |
System → Main | Tray icon mouse event |
WM_UPDATE_AVAIL |
WM_USER+11 |
Thread → Main | Newer version found |
WM_AUTO_REFRESH |
WM_USER+12 |
Timer → Main | Auto-refresh interval elapsed |
WM_SCRIPT_STARTED |
WM_USER+13 |
Thread → Main | A background script started; enables ■しかく Stop and turns the running button green |
WM_SCRIPT_STOPPED |
WM_USER+14 |
Thread → Main | A background script exited or was terminated; disables ■しかく Stop and clears the green highlight |
Timer IDs:
| Constant | Value | Description |
|---|---|---|
TIMER_AUTO_REFRESH |
1001 |
SetTimer ID for the periodic auto-sync interval |
TIMER_QBAR |
1002 |
SetTimer ID used by the Quick Launch Bar for visibility polling |
Hotkey IDs:
| Constant | Value | Description |
|---|---|---|
HOTKEY_QBAR_TOGGLE |
1 |
RegisterHotKey ID on the main window; WM_HOTKEY routes it to IDM_QBAR_TOGGLE
|
All colours are defined as #define pairs (dark/light) and accessed via inline runtime functions that check g.dark_mode:
// Defined as macros: #define COL_BG_DARK RGB(28, 28, 35) #define COL_BG_LIGHT RGB(240, 240, 245) // Accessed via inline function: static inline COLORREF COL_BG(void) { return g.dark_mode ? COL_BG_DARK : COL_BG_LIGHT; }
Runtime accessor functions (dark/light):
| Function | Dark | Light | Used for |
|---|---|---|---|
COL_BG() |
#1C1C23 |
#F0F0F5 |
Main window background |
COL_TOOLBAR() |
#141418 |
#D2D2DC |
Toolbar and tab bar |
COL_BTN_NORM() |
#2C2E40 |
#DCDEED |
Script button normal |
COL_BTN_HOT() |
#3E415A |
#BEC3DC |
Script button hover |
COL_BTN_PRESS() |
#1C1E30 |
#AAAFCD |
Script button pressed |
COL_INFO_ZONE() |
#24263A |
#C8CAD8 |
Script button info badge zone |
COL_TEXT() |
#D2D7F0 |
#1E1E28 |
Primary text |
COL_SUBTEXT() |
#6E7494 |
#646478 |
Secondary text, purposes |
COL_DIVIDER() |
#2E3042 |
#BEC0D2 |
Separators and borders |
COL_TIP_BG() |
#161620 |
#F5F5FC |
Tooltip background |
Fixed-colour constants (no theme variant):
| Constant | Value | Used for |
|---|---|---|
COL_ACCENT |
RGB(82, 155, 245) |
Highlights, selected tabs, accent bars |
COL_ACCENT_DIM |
RGB(48, 92, 160) |
Dimmed accent for pressed states |
COL_SUCCESS |
RGB(80, 200, 120) |
Success/OK indicators; running script button highlight |
COL_WARN |
RGB(240, 190, 60) |
Warning/repeat-mode indicators |
COL_STAR |
RGB(255, 200, 60) |
Favourite star badge |
COL_TIP_BORDER |
RGB(82, 155, 245) |
Tooltip popup border |
Getting Started
Using the App
Scripts
Reference
Development
Legal