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

Author Topic: Is RenderWindow Style::None incompatible with WS_EX_TOPMOST?  (Read 1842 times)

0 Members and 1 Guest are viewing this topic.

tbop

  • Newbie
  • *
  • Posts: 34
    • View Profile
Hi there,


Every time I've tried to set that Extended Window Style property once I've created a RenderWindow (Style::None) it returns me an error and the property wasn't applied.

Finally to make it work, I had to change the source code in WindowImplWin32.cpp.
What I did was just to add another DWORD variable dwExStyle set to this property and to change the macro CreateWindowW and CreateWindowA since they didn't take any extended window style into account.

Is it normal? I've tested the same code with another hwnd I create manually and it works fine.
What makes it fail here then with Sfml?


Cheers!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Is RenderWindow Style::None incompatible with WS_EX_TOPMOST?
« Reply #1 on: June 20, 2013, 12:31:35 pm »
I have no idea, you'll have to investigate yourself if you want an answer.

You can copy the window creation code from SFML, as a starting point ot investigate.
Laurent Gomila - SFML developer

tbop

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Is RenderWindow Style::None incompatible with WS_EX_TOPMOST?
« Reply #2 on: June 20, 2013, 01:40:25 pm »
I've spent the last four days struggling with that until I came to modifying the source code itself.
I wonder whether it's because the window is created without any extended window style. I think I just give up for now and keep with the altered version of SFML I've just made.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Is RenderWindow Style::None incompatible with WS_EX_TOPMOST?
« Reply #3 on: June 20, 2013, 01:56:30 pm »
Window creation is basically just a single line of code, so it shouldn't be hard to compare it to the one you wrote yourself and find the difference, right?
Laurent Gomila - SFML developer

tbop

  • Newbie
  • *
  • Posts: 34
    • View Profile
Re: Is RenderWindow Style::None incompatible with WS_EX_TOPMOST?
« Reply #4 on: June 20, 2013, 03:28:45 pm »
As I said, I've been trying to do this for 3 days now. Here is what I did:

1) If I do my own window with all the properties I need the creation won't fail.
2) If I do my own window, create it and set that extended property afterward it won't fail.
3) If I hack the code of WindowsImplWin32 and make sure the window is created with this property it won't fail.
4) If I don't hack the code and get the SystemHandle and change the property then it fails.

I don't know what else I could try.
I've got the feeling that if this property isn't initialized at the very beginning then it can't be done afterward.... Although it works just fine with the example 1. Hum I guess there's a slight change I don't see here. I'll continue my investigation and let you know if I find anything.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Re: Is RenderWindow Style::None incompatible with WS_EX_TOPMOST?
« Reply #5 on: June 20, 2013, 03:36:20 pm »
Quote
I don't know what else I could try.
Pick the line of code that creates the SFML window and insert it into your own Win32 code that works. That's the very first thing I would do, since it gets rid of all the SFML environment to keep only the relevant code to test and debug.
Laurent Gomila - SFML developer