I have no idea about iocp, but yes, if you need to hook into the event queue on Windows you can attach your own handler like this:
#include <SFML/Graphics.hpp>
#include <Windows.h>
LONG_PTR SfmlEventCallback = 0x0;
LRESULT CALLBACK CustomEventCallback(HWND handle, UINT message, WPARAM wParam, LPARAM lParam)
{
if (message == WM_MENU...)
{
// Your event handling
}
return CallWindowProcW(reinterpret_cast<WNDPROC>(SfmlEventCallback), handle, message, wParam, lParam);
}
int main()
{
auto app = sf::RenderWindow{ { 640u, 480u }, "Custom Event Handling" };
HWND handle = app.getSystemHandle();
SfmlEventCallback = SetWindowLongPtrW(handle, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(CustomEventCallback));
while (app.isOpen())
{
for (auto event = sf::Event{}; app.pollEvent(event);)
{
if (event.type == sf::Event::Closed)
{
app.close();
}
}
app.clear();
app.display();
}
}