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
SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
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
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
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
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);