And to be honest, I don't get the "don't add a feature because some people will misuse it", after all, c++'s mentality with the standard is quite the opposite: make hundreds of tools available to anyone, even if they end up misused.SFML is not a language, but a library and every library maintainer can make their own rules of what to dis-/allow and what guidelines to follow. "But others have it" is never a real argument. ;)
windows.h defines the min and max macros.
The cleanest solution is to define the NOMINMAX preprocessor symbol in your project settings.
Because windows.h doesn't define those macros if the NOMINMAX preprocessor symbol is defined :)#ifndef NOMINMAX
#define min ...
#define max ...
#endif
Sure, but how does that fix it? Does SFML define them too?No, but SFML uses std::min and std::max. If the preprocessor replaces 'min' and 'max' with the Windows macros, the result is an invalid C++ expression.
"BringWindowToTop()" does not work.Yes, it turns out it only worked when I had focus in the console of the program actually.
SetWindowPos(window.getSystemHandle(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS | SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);Yes, it works, where did you get that if you don't know these flags? You can read what flags do (NOMOVE and NOSIZE are obvious and that's why those 4 zeroes don't do anything and TOPMOST is why the window ends up on top) on: https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setwindowpos