digitalmars.D.learn - Window created with Windows API is not visible
- solidstate1991 (9/9) Jun 18 2022 Code:
- Vinod K Chandran (3/3) Jun 18 2022 On Saturday, 18 June 2022 at 21:03:23 UTC, solidstate1991 wrote:
- solidstate1991 (4/6) Jun 18 2022 Did not set the flags for the layered window style, so I don't
- rikki cattermole (13/13) Jun 18 2022 registeredClass.style = 32_769;
- solidstate1991 (4/18) Jun 18 2022 Well, it seems like my window callback wasn't right. Now at least
- rikki cattermole (2/2) Jun 18 2022 A white content area, means that you didn't draw something.
- Adam Ruppe (3/4) Jun 18 2022 you might consider using another exisitng lib. my simpledisplay.d
- solidstate1991 (3/3) Jun 20 2022 It seems I solved most of the problems by modifying event
Code: https://github.com/ZILtoid1991/iota/blob/main/inputtest/app.d https://github.com/ZILtoid1991/iota/blob/main/source/iota/window/base.d#L104 Second one contains the constructor that should make the window without any issues. When I try to create a window for testing purposes, I get nothing besides of an icon on the taskbar. Once I was able to get a quite broken window to show up, then it doesn't showed up anymore. Calling the API function `IsWindowVisible` returns true.
Jun 18 2022
On Saturday, 18 June 2022 at 21:03:23 UTC, solidstate1991 wrote:It seems that you are created a layered window. So chances are there to it become translucent.
Jun 18 2022
On Saturday, 18 June 2022 at 21:33:31 UTC, Vinod K Chandran wrote:It seems that you are created a layered window. So chances are there to it become translucent.Did not set the flags for the layered window style, so I don't know. Might be an event processing error, since in Windows it's a mess.
Jun 18 2022
registeredClass.style = 32_769; Don't use an integer like that, stick with bit wise ors. LPCWSTR classname = toUTF16z(name); GC owned memory, that could result in surprises. const LPWSTR windowname = toUTF16z(title); Ditto I'm not sure your window callback procedure is right. For instance you are not calling DefWindowProc, and you are not handling WM_PAINT in any form. But one other thing, your approach to the event loop is going to come back to bite you at some point. Windows is based around a push event loop model, not a pull like other system Windowing libraries (such as X11). It can get recursive. I learned this one the hard way.
Jun 18 2022
On Saturday, 18 June 2022 at 22:46:45 UTC, rikki cattermole wrote:registeredClass.style = 32_769; Don't use an integer like that, stick with bit wise ors. LPCWSTR classname = toUTF16z(name); GC owned memory, that could result in surprises. const LPWSTR windowname = toUTF16z(title); Ditto I'm not sure your window callback procedure is right. For instance you are not calling DefWindowProc, and you are not handling WM_PAINT in any form. But one other thing, your approach to the event loop is going to come back to bite you at some point. Windows is based around a push event loop model, not a pull like other system Windowing libraries (such as X11). It can get recursive. I learned this one the hard way.Well, it seems like my window callback wasn't right. Now at least I get whiteness instead of nothing. This is going to be a long match.
Jun 18 2022
A white content area, means that you didn't draw something. As long as the border ext. is showing up, you're ok.
Jun 18 2022
On Saturday, 18 June 2022 at 23:00:36 UTC, solidstate1991 wrote:This is going to be a long match.you might consider using another exisitng lib. my simpledisplay.d does all this and much more for example
Jun 18 2022
It seems I solved most of the problems by modifying event handling. I'll continue solving further ones and adding more functionality.
Jun 20 2022