Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

olle55

Window resize question.

This topic is 5743 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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!

Share this post


Link to post
Share on other sites
Advertisement
This is the window style I use for non-resizing windows:


#define wndStyle WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX & ~WS_THICKFRAME

Share this post


Link to post
Share on other sites
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 );

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!