File Reference
Descriptions of every source file, key data structures, and important functions.
Contents
Source Files
main.h
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())
main.c
Entry point and main window procedure.
wWinMain— app startup: loads settings, creates window, starts sync and update threads, runs message loopMainWndProc— handlesWM_PAINT,WM_SIZE,WM_COMMAND,WM_DRAWITEM,WM_SETTINGCHANGE,WM_TRAYICON,WM_SYNC_DONE,WM_UPDATE_AVAIL,WM_CLOSE,WM_DESTROYHandle_Command— routes allWM_COMMANDmessages to appropriate actionsHandle_SyncDone— called on main thread when sync completes; ifSR_NO_INTERNETsetsg.status_offline(amber status bar) and optionally clears tabs whenoffline_use_cacheis off; otherwise rebuilds tabs and restores the active tab by folder name (viag.active_folder_name) to prevent drift whenTabs_BuildFavouritesshifts indicesApp_InitGDI/App_FreeGDI/App_RebuildGDI— create/destroy/recreate all GDI resourcesApp_BuildAppDataPath— buildsg.appdata_dirfrom%APPDATA%\CatiaMenuWin32and creates the directory if it does not existApp_ResolveTheme— setsg.dark_modebased oncfg.themeand Windows registry
resource.h
All #define IDs for menus, dialogs, and controls. Grouped by:
- Icon:
IDI_APP_ICON - Menu:
IDR_MAINMENU,IDM_*(includesIDM_CHECK_UPDATES = 244for Help → Check for Updates) - 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.c
Window creation, tab bar, tray icon, and popup menu.
Window_Create— registers all window classes, creates main window and all child controls (Menu, Refresh, Settings, Deps, Stop); Stop button starts disabled and is enabled/disabled byWM_SCRIPT_STARTED/WM_SCRIPT_STOPPEDWindow_OnSize— repositions tab bar, scroll panel, and status bar on resizeWindow_ApplyDarkMode— callsDwmSetWindowAttributefor title bar dark modeWindow_ApplyAlwaysOnTop— callsSetWindowPoswithHWND_TOPMOST/HWND_NOTOPMOSTWindow_ShowMenu— builds and shows the hamburger popup menu viaTrackPopupMenuWindow_AddTrayIcon/Window_RemoveTrayIcon— manageNOTIFYICONDATAWindow_ShowTrayMenu— builds and shows the right-click context menu for the system tray iconWindow_ApplyThemeToChildren— resets the status bar visual style and invalidates the tab bar, status bar, and all child windows after a theme changeWindow_OpenExeFolder— opens the folder containing the running.exein Windows Explorer viaShellExecuteWindow_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 wheelTabBar_NaturalWidth— measures tab label width withGetTextExtentPoint32WTabBar_NeedsArrows— returns true when total tab width exceeds bar widthStatusBarProc— custom owner-drawn status barWndProc
tabs.c
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_RebuildButtonsTabs_RebuildButtons— destroys existing script buttons and creates new ones for active tab; skips hidden and filtered-out scriptsTabs_DestroyButtons— removes allIDC_SCRIPT_BTN_BASE+nchild windowsTabs_ApplyFilter— rebuilds the button grid for the active tab showing only scripts matchingg.filter_text; delegates toTabs_RebuildButtonsTabs_ScriptMatchesFilter— returns true if the script’s name or purpose containsg.filter_text(case-insensitive); always returns true when filter is emptyTabs_ApplySort— sortsfolder.scripts[]in-place viaqsortusing the activeSortMode;SORT_ORDERis a no-op (preserves API/disk order)Tabs_FolderHasVisible— returns true if the folder contains at least one non-hidden script; used to suppress empty tabsScrollPanelProc— scroll panelWndProc; handlesWM_VSCROLL,WM_MOUSEWHEEL,WM_DRAWITEMfor script buttons;WM_DRAWITEMcopies theScriptstruct undercs_foldersto prevent concurrent realloc from the sync thread invalidating the pointer during paint
paint.c
All GDI rendering. Every function uses double-buffering (memory DC + BitBlt).
Paint_MainWindow— draws toolbar background, title, version, syncing indicator, update badgePaint_ToolbarButton— owner-draw forBS_OWNERDRAWtoolbar buttons (Menu, Refresh, Settings, Deps, Stop); renders pressed/hot/normal/disabled states; the Stop button uses a red accent when enabledPaint_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; copies theScriptstruct undercs_foldersbefore painting to prevent use-after-free if the sync thread reallocsf->scriptsconcurrentlyTip_ComputeHeight— measures tooltip height usingDT_CALCRECTwith correct fontBtnSubclassProc— 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); tooltip hover acquirescs_foldersto safely copy the script before callingMeta_ParseandTip_ComputeHeight
github.c
All GitHub API communication.
GitHub_HttpGet— opens an HTTPS connection, validates the server certificate, sends a GET request, reads the responseGitHub_VerifyCert— checks cert subject containsgithub.com/github.ioand issuer is a known CAGitHub_DownloadRaw— downloads a raw file fromraw.githubusercontent.comGitHub_DownloadRawFull— downloads from a specified host/path (used for extra repos)GitHub_ComputeFileSHA1— computes Git blob SHA1 (SHA1("blob <size>\0<content>")) using Windows CryptAPIGitHub_VerifyScriptSHA— compares computed SHA againsts->shafrom the APIGitHub_ParseOwnerRepo— extractsownerandrepofrom a full GitHub URLGitHub_ParseRoot— parses the contents API JSON to find folder entries; holdscs_foldersfor the entire function to guardg.folder_countmodifications andFolder_FreecallsGitHub_ParseFolder— parses a folder’s contents JSON to find.pyscript entries; holdscs_foldersfor the entire parse loop soFolder_Pushreallocs cannot race with UI-thread reads off->scripts
sync.c
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; if the GitHub connection fails, postsSR_NO_INTERNETwithout clearing the cache pre-loaded bySync_LoadManifest(whenoffline_use_cacheis on), or clears it and posts an offline message (when off)Sync_LoadManifest— called at startup: scanscache_diron disk to populateg.folders[]immediately without internetSync_SaveManifest— writes all current SHA values tomanifest.iniSync_GetLocalSHA— reads a script’s SHA frommanifest.iniSync_MergeFolder— adds scripts to an existing folder or creates a new one; used for merging sources; holdscs_foldersfor the entire operation to guardFolder_Pushreallocs andg.folder_countmodificationsSync_ExtraRepo— syncs one extra GitHub repositorySync_LocalDir— scans a local folder, treats subfolders as tabs, skipssetup/DeleteLocalScript— deletes a cached script file and removes empty parent directories
runner.c
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 go throughRunner_BuildLocalPath, 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 threadRunner_Thread— creates process forpython script.py(with optionalcmd /kwrapper); for background runs, duplicates the process handle intog.run_process, postsWM_SCRIPT_STARTED, waits up to 30 minutes, then atomically clears the handle and postsWM_SCRIPT_STOPPEDRunner_Stop— atomically claimsg.run_processviaInterlockedExchangePointer, callsTerminateProcess, and postsWM_SCRIPT_STOPPEDto disable the Stop buttonRunner_FindPython— searches PATH,cfg.python_exe, and common install locationsRunner_RunWithArgs— runs a script with additional command-line arguments; usesEscapeForCmdto prevent shell injection in thecmd.exe /kkeep-open pathEscapeForCmd— escapes^,", and%so user-supplied arguments cannot inject commands intocmd.exeRunner_UpdateDeps— upgrades pip then runspip install --upgrade -r requirements.txtfor each source sequentiallyRunPipInstall— runs one pip install command and waits for it to complete
meta.c
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,DescriptionMeta_ParseAll— callsMeta_Parseon every script ing.folders[]
Header format expected (see Writing Your Own Scripts in the user guide for full details):
'''
-------...------
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.
help.c
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 ContentsHelpDlgProc— 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 panesHelp_GetRTF— returns RTF-formatted content string for each of the 12 help topicsHelp_TopicLabel— returns the display name for each topicHelp_LoadTopic— streams RTF content into the RichEdit control viaEM_STREAMIN
prefs.c
User preferences persistence and script management dialogs.
Prefs_IsFavourite/Prefs_SetFavourite— read/write favourite state toprefs.iniPrefs_IsHidden/Prefs_SetHidden— read/write hidden statePrefs_GetRunCount/Prefs_IncrementRunCount— track script run counts for Most Used sortPrefs_GetNote/Prefs_SetNote— per-script user notesPrefs_ApplyToFolders— stamps all scripts with their prefs after every syncTabs_BuildFavourites— builds a⭐ Favouritestab at index 0 when any scripts are favourited; removes existing tab first to prevent duplicatesScriptDetailsDlgProc— full script details dialog with all header fields, note, favourite/hidden togglesRunWithArgsDlgProc— dialog to enter command line arguments before runningScriptNoteDlgProc— quick note edit dialogHiddenScriptsDlgProc— manage hidden scripts with Unhide and Unhide All
sources.c
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.c
Settings persistence and dialogs.
Settings_Load— readssettings.iniusingGetPrivateProfileString/Int; sets defaults for missing valuesSettings_Save— writes all settings tosettings.iniSettings_ApplyAutorun— adds/removes the app fromHKCU\...\Runregistry keySettingsDlgProc— dialog proc forIDD_SETTINGS; includes Reset to DefaultsAboutDlgProc— dialog proc forIDD_ABOUT
updater.c
Checks GitHub Releases API for newer versions.
Updater_CheckThread— background thread: waits 3 s for sync to finish (skipped for manual checks), calls releases API, comparesmajor.minor.patch; pass non-NULLlpParamto trigger a manual check that shows “up to date” status if no update is foundUpdater_AutoUpdate— downloads the new.exedirectly via WinINet, writes a batch script to replace the binary, then postsWM_CLOSE; falls back toUpdater_PromptAndInstallon any failureUpdater_PromptAndInstall— shows the update dialog and opens the releases page if confirmedIsNewer— compares remote and local versions (first 3 parts only, ignores build number)ParseVersion— splits"1.2.3.4"into anint[4]without locale-dependentswscanfParseLatestTag— extractstag_namefrom releases API JSON
quickbar.c
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_CreateQuickBar_Create— creates the floating bar window (WS_POPUP | WS_BORDER) and its tooltip companion; installsSetWinEventHookcallbacks forEVENT_SYSTEM_FOREGROUNDandEVENT_SYSTEM_MINIMIZESTART/ENDQuickBar_Destroy— destroys bar and tooltip windows, unhooks both WinEvent hooks, deletes the label fontQuickBar_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 barQuickBar_OnThemeChange— reappliesDwmSetWindowAttributedark mode and repaints both windows on theme changeQuickBar_SetTopmost— sets or clearsHWND_TOPMOSTon the bar windowQuickBar_ShowTargetDlg— opens theIDD_QBAR_TARGETdialog to set the window-title tracking substring
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-bufferingQB_Paint— double-buffered render of bar background, scroll arrows (▲▼ / ◄►), and all 2-letter abbreviation buttons with accent bar on hoverQB_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_UpdateScrollMaxQB_CatiaState— enumerates all top-level windows viaEnumWindowsand returnsCATIA_NONE,CATIA_MINIMIZED, orCATIA_VISIBLEbased on the tracked title substringQB_UpdateVisibility— central dispatcher called from both WinEvent hooks; hides bar when target is absent/minimised, setsHWND_TOPMOSTwhen target gains focus
Key Structs
SortMode / ThemeMode (enums)
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;
SyncStatus / SyncResult
Communicates the outcome of a background sync from Sync_Thread to the main window via WM_SYNC_DONE. The SyncResult pointer is passed as wParam; Handle_SyncDone reads it and frees it.
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;
ExtraRepo
One user-added GitHub repository script source. Loaded from settings.ini and passed to Sync_ExtraRepo.
typedef struct {
WCHAR url[512];
WCHAR branch[64];
WCHAR token[256];
bool enabled;
} ExtraRepo;
LocalDir
One user-added local folder script source. Loaded from settings.ini and passed to Sync_LocalDir.
typedef struct {
WCHAR path[MAX_APPPATH];
bool enabled;
} LocalDir;
ScriptMeta
Parsed header fields from a script file. Populated by Meta_Parse; read by Paint_Tooltip, ScriptDetailsDlgProc, and Tabs_ApplySort.
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;
AppState (g)
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;
bool syncing;
bool status_offline; /* true when showing stale cache due to no internet */
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;
CRITICAL_SECTION cs_folders; /* guards folders[] and folder_count between sync and UI threads */
volatile HANDLE run_process; /* duplicated handle of bg script process; NULL when idle */
/* 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 */
/* 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;
Settings
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 */
bool offline_use_cache; /* show cached scripts when offline (default: false) */
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 repeat_on_dblclick; /* repeat main-window scripts on double-click */
bool qbar_repeat_on_dblclick; /* repeat Quick Bar scripts on double-click */
} Settings;
ScriptFolder
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.
Script
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;
Constants and Limits
String / 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 in prefs.ini |
MAX_HIDDEN |
256 | Maximum entries in the hidden-scripts list in prefs.ini |
MAX_NAME |
128 | Wide character buffer for names, tab labels, filter text |
MAX_SHA |
64 | Wide character buffer for a Git blob SHA1 hex 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 |
BTN_GAP |
6 | Vertical gap between script buttons |
BTN_MX |
12 | Script button horizontal margin |
BTN_MY |
10 | Script button vertical margin |
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 IDs
| 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 |
Runner → Main | Background script launched; enables the Stop button and turns the running button green |
WM_SCRIPT_STOPPED |
WM_USER+14 |
Runner → Main | Background script exited or was terminated; disables the Stop button 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 |
Colour System
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 status indicators |
COL_STAR |
RGB(255, 200, 60) |
Favourite star badge |
COL_TIP_BORDER |
RGB(82, 155, 245) |
Tooltip popup border |