How to achieve Steam-like window using winapi?

前端 未结 1 2045
醉酒成梦
醉酒成梦 2021-02-10 10:31

\"Steam This is a screenshot of Steam\'s client window being resized.

Steam\'s client window has two cool

相关标签:
1条回答
  • 2021-02-10 10:52

    Basically, you can do almost anything with your window. But most of the tricks are to be implemented manually.

    1. What is 'very responsive' I don't know. If you mean that the window has no standart border, it is easy to implement: do not specify WS_BORDER and WS_CAPTION when creating a WS_POPUP window. After that you will have to draw a border and a caption yourself. Handle WM_ERASEBKGND and WM_PAINT messages, draw background, menus, all as usual.
    2. This effect seems to me more like a bug. It happens this way: the window is resized, it gets a WM_SIZE message, processes it, Windows sends a WM_ERASEBKGND message which the window ignores. Thus, the system draws a new shadow around new window frame which is not yet filled with new window image. And here we get this cool glass effect: old image of underlaying windows with a windows aero shadow. You can try to disable windows shadows and look at this effect.

    In order to create a custom resizing border, you might find useful these functions: LoadCursor, SetCursor, MoveWindow.

    In order to draw your custom borders, you can use standart GDI functions. Also you can create a handful of child windows and delegate drawing to them. This is basics of winapi.

    0 讨论(0)
提交回复
热议问题