Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Gustavo72s

Pages: [1]
1
Window / Re: How to process events from a menu
« on: October 30, 2021, 06:57:04 pm »
eXpl0it3r:
Thank you very much, this just works!

2
Window / How to process events from a menu
« on: October 23, 2021, 12:32:31 pm »
Hello.

I'm trying to add a Windows API menu to an SFML window.
And I achieved it with this code:

#include <SFML/Graphics.hpp>
#include "windows.h"

int main() {
        sf::RenderWindow win(...);
        HWND hWnd = win.getSystemHandle();
       
        HMENU hMenu = CreateMenu();
        AppendMenu(...);
        AppendMenu(...);
        ...
        AppendMenu(...);
       
        SetMenu(hWnd, hMenu);
        while(win.isOpen()) {
                sf::Event event
                while(win.pollEvent(event)) {
                        ...
                }
        }
        return 0;
}
 

But I can't detect the menu events.

I understand that pollEvent only returns events from SFML and filters other events like those generated by the menu.

How can I go about implementing something like WindowProcedure before getting to pollEvent?

Thanks!

Pages: [1]
anything