Window resize question.

Started by
9 comments, last by olle55 21 years, 6 months ago
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:
  
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 );
  
Thanks in advance!
Advertisement
Create a window that doesn''t include the WS_THICKFRAME style (don''t use WS_OVERLAPPEDWINDOW). See Window Styles on MSDN.
// Ryan
gaaaah!
i have now tried them all, they all resize! =(
This is the window style I use for non-resizing windows:

#define wndStyle WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME 

My program dont run if i compile it with that. =(
Could you be a little more specific? How about a code snippet?
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:

  	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 );  
How are you initializing DD?
(WS_OVERLAPPEDWINDOW | WS_VISIBLE) & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME
What he said^, or call ShowWindow
- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara

This topic is closed to new replies.

Advertisement