logoalt Hacker News

ahartmetztoday at 10:25 AM3 repliesview on HN

> Win32 does not revolve around an update loop you own

    while (GetMessage(&msg, NULL, 0, 0) > 0) {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }
...How much more could you own it, really? Is that the LLM talking?

Replies

Dwedittoday at 6:46 PM

"GetMessage" can do a lot of things you don't expect it to do. Ever used a global keyboard hook? Your keyboard handler code is called because "GetMessage" is calling other functions to have it get handled.

sumtechguytoday at 1:04 PM

Had one project where for some reason one of the devs wanted to access the messages before it got translated. The reasons are lost to time. You technically could create other types of application that is not CLI or 'windows'. But then you are own your own making the queues or console items. Think they were typically used for device drivers or background service manager tasks.

https://learn.microsoft.com/en-us/cpp/build/reference/subsys...

Pretty sure it just changes out what the default function that is called before winmain. So you probably could just switch out the first function called (dont remember the cli option for that).

Most of the time you just picked the right type at project creation so it would feed correctly into the project solution which would set the right flags on build. But technically you could pick the most basic one and do it all yourself.

pharringtontoday at 11:01 AM

He means its about a message loop, as opposed to an update loop.

show 1 reply