Skip to content

Conversation

@Frqmelikescheese
Copy link

Adds an AI assistant directly to the taskbar with three modes (Chat, Code, Creative). Uses OpenRouter API with configurable model selection. Features a modern UI with syntax highlighting and mode-switching tabs.

}
case WM_CTLCOLOREDIT: {
HDC hdc = (HDC)wParam; SetBkMode(hdc, TRANSPARENT); SetTextColor(hdc, C_TEXT); SetBkColor(hdc, C_INPUT);
return (LRESULT)CreateSolidBrush(C_INPUT);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A new brush is created on every WM_CTLCOLOREDIT message but never deleted. This will leak GDI objects over time. Cache the brush as a static/global and reuse it.

if (g_currentMode == 1) sys = L"You are a master programmer. Code only.";
if (g_currentMode == 2) sys = L"You are a creative writer.";

CreateThread(NULL, 0, ApiThread, new ThreadData{prompt, sys}, 0, NULL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thread handles are never closed. Each API call leaks a handle.


BOOL Wh_ModInit() {
LoadSettings();
if(g_apiKey.empty()) { MessageBox(NULL, L"Please set API Key", L"Windhawk", MB_OK); return FALSE; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add MB_TOPMOST to make the message box more visible.

// @version 1.1
// @author Frqme
// @github https://github.com/Frqmelikescheese
// @include explorer.exe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't addressed.

@Frqmelikescheese
Copy link
Author

Frqmelikescheese commented Jan 12, 2026

ok updated it not sure if i gotta do anything else im not familiar with github
Note:
the mod shouldnt require a explorer restart but if it does then yes

BOOL Wh_ModInit() {
LoadSettings();
if(g_apiKey.empty()) {
MessageBox(NULL, L"Please set API Key", L"Windhawk", MB_OK | MB_TOPMOST);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MB_TOPMOST doesn't seem to be enough, replace it with MB_SYSTEMMODAL.

// @include explorer.exe
// @compilerOptions -luser32 -lgdi32 -ldwmapi -lwinhttp -lcomctl32
// ==/WindhawkMod==

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a readme (mod description) that says what the mod is about and how to use it.

// @version 1.1
// @author Frqme
// @github https://github.com/Frqmelikescheese
// @include explorer.exe
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wasn't addressed.

@Frqmelikescheese
Copy link
Author

should be good

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants