opening a window that has no title bar with win32

前端 未结 5 1015
无人共我
无人共我 2020-12-08 05:24

I\'m developing a c++ application for windows. I\'m using win32 API. I have a very simple question, which i couldn\'t find an answer to. How can i open a window without a ti

相关标签:
5条回答
  • 2020-12-08 05:30
    SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
    
    0 讨论(0)
  • 2020-12-08 05:40
    hWnd = CreateWindow(szWindowClass, 0, (WS_BORDER ), 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, hInstance, NULL); 
    
    SetWindowLong(hWnd, GWL_STYLE, 0); //remove all window styles, check MSDN for details
    
    ShowWindow(hWnd, SW_SHOW); //display window
    
    0 讨论(0)
  • 2020-12-08 05:45
    CreateWindowEx(0, szWindowClass, 0, WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_POPUP, 0, 0, WINDOW_WIDTH, WINDOW_HEIGHT, NULL, NULL, hInstance, NULL);
    

    using SetWindowLong will change the size and post. use the WS_POPUP style

    0 讨论(0)
  • 2020-12-08 05:52

    Omit the WS_BORDER style:

    See CreateWindow function: http://msdn.microsoft.com/en-us/library/ms632679%28v=vs.85%29.aspx

    Window Styles: http://msdn.microsoft.com/en-us/library/ms632600%28v=vs.85%29.aspx

    0 讨论(0)
  • 2020-12-08 05:53
    HWND hWnd ;
    hWnd = CreateWindow(szWindowClass, 0, (WS_BORDER ), 0, 0, 100, 100, NULL, NULL, Instance, NULL); 
    SetWindowLong(hwnd, GWL_STYLE, WS_BORDER );  // With 1 point border
    //OR
    SetWindowLong(hwnd, GWL_STYLE, 0 );  // Without 1 point border = white rectangle 
    SetWindowPos(hwnd, 0, 150, 100, 250, 250, SWP_FRAMECHANGED); 
    
    if (!hWnd)
     return FALSE ;
    else
    ShowWindow(hwnd, SW_SHOW);
    
    0 讨论(0)
提交回复
热议问题