简体   繁体   中英

Win32 programming child window does not have exit button

Hi I am writing a Win32 Windows program. I created a child window with the following command

case ID_VIEW_CARVIEW:

            carViewHwnd = CreateWindowEx(WS_EX_TOPMOST, L"Edit", L"Edit",
                WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_BORDER,
                000, 00, 656, 519, hWnd, (HMENU)NULL, GetModuleHandle(NULL), NULL);
            SetWindowLongPtr(carViewHwnd, GWLP_WNDPROC, (LONG_PTR)CarViewWndProc);

However, this child windows has two problems:

  1. It does not have a "close" button on the top right.
  2. It always stay on top of all windows on my desktop top.

How can I change it?

  1. It does not have a "close" button on the top right.

You need set WS_SYSMENU flag for dwStyle parameter to have a window menu on its title bar.

  1. It always stay on top of all windows on my desktop top.

Because you define WS_EX_TOPMOST style: "The window should be placed above all non-topmost windows and should stay above them, even when the window is deactivated."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM