WNDCLASS wc;
HWND hWnd;
// Register the Window Class
wc.lpszClassName = TEXT("Tetris");
wc.lpfnWndProc = MsgProc;
wc.style = CS_VREDRAW | CS_HREDRAW;
wc.hInstance = hInst;
wc.hIcon = LoadIcon( hInst, MAKEINTRESOURCE(IDI_ICON1) );;
wc.hCursor = LoadCursor( NULL, IDC_ARROW );
wc.hbrBackground = (HBRUSH) GetStockObject(BLACK_BRUSH);
wc.lpszMenuName = NULL;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
if( !RegisterClass( &wc ) )
return E_FAIL;
hWnd = CreateWindowEx( 0, TEXT("Tetris"), TEXT("Tetris"),
WS_OVERLAPPEDWINDOW | WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInst, NULL );
Window resize question.
Hello.
I am writing a ddraw application in windowe mode, and when you put the mouse cursor on a edge of it, you get the resize cursor and you can resize it. I dont want that to be possible. How do i create a window that is not resizeable?
This is my code for creating a window:
Thanks in advance!
Create a window that doesn''t include the WS_THICKFRAME style (don''t use WS_OVERLAPPEDWINDOW). See Window Styles on MSDN.
This is the window style I use for non-resizing windows:
#define wndStyle WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME
Sure, it compiles fine, but when i try to run it nothing happens, but if i press alt+ctrl-del i see the program there, i have to kill it if i want to compile again. I can''t alt+tab to it either.
This is the code i use to create the window:
This is the code i use to create the window:
hWnd = CreateWindowEx( 0, TEXT("Tetris"), TEXT("Tetris"), WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInst, NULL );
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement