Skip to content

It takes a few seconds for WindowTop to switch a window to dark mode #482

@PaulSinnema

Description

@PaulSinnema

My guess is that WindowTop is polling for new Windows to open. Would it be possible to react to Windows events instead so windows go to dark mode immediately?

Something like:

HWINEVENTHOOK hook;

void CALLBACK WinEventProc(
    HWINEVENTHOOK hWinEventHook,
    DWORD event,
    HWND hwnd,
    LONG idObject,
    LONG idChild,
    DWORD idEventThread,
    DWORD dwmsEventTime)
{
    if (event == EVENT_OBJECT_CREATE && idObject == OBJID_WINDOW)
    {
        // A window was created
    }
}

hook = SetWinEventHook(
    EVENT_OBJECT_CREATE,
    EVENT_OBJECT_CREATE,
    NULL,
    WinEventProc,
    0,
    0,
    WINEVENT_OUTOFCONTEXT);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions