I wanted to use a window style that was border-less or had a 1 pixel wide border, but was re-sizable. It was not actually possible so I tried changing the window style with SetWindowLong() then using SetWindowPos() with SWP_FRAMECHANGED and AdjustWindowRect()

It allowed me to resize the window but it made a strange border inside of my window : http://img268.imageshack.us/img268/1797/prevfb.png

And now just using any window style makes a border just like that inside all of my windows. No matter what I do its always there even without changing it at all.

I am using a console application that creates a win32 window along with it:

Main function

int main()
	srand( GetTickCount() );

	Engine.Hook_Window( 0, "test" );
	Engine.Win.m_szAppName			= "Demo Window";
	Engine.Win.m_hInstance			= ( HINSTANCE )GetWindowLong( GetConsoleWindow(), GWL_HINSTANCE );
	Engine.Win.m_dwWindowStyle		= WS_POPUP;
	Engine.Win.m_dwThread_Sleep_Time	= 10;

	Engine.Win.SetWndClass( "Demo_Class",
							MainProc, 0, 
							LoadCursor( Engine.Win.m_hInstance, IDC_ARROW ), 
							LoadIcon(Engine.Win.m_hInstance, IDI_APPLICATION ), 
							( HBRUSH )GetStockObject( 0 ) );


	Engine.Win.m_hwApp		= CreateWindowEx( WS_EX_LAYERED, "Demo_Class", Engine.Win.m_szAppName.c_str(), Engine.Win.m_dwWindowStyle, 200, 200, Engine.Win.Width( WINDOW_ID_HOOKED ), Engine.Win.Height( WINDOW_ID_HOOKED ), 0, 0, Engine.Win.m_hInstance, 0 );
	Engine.Win.m_hCalcThread	= CreateThread( 0, 0, ( LPTHREAD_START_ROUTINE )CalcThread,  0, 0, 0);
	Engine.Win.Set_ColorKey( RGB( 0, 0, 255 ) );

	ShowWindow( Engine.Win.m_hwApp, SW_SHOW );
	UpdateWindow( Engine.Win.m_hwApp );

	while( GetMessage( &Engine.Win.m_Msg, 0, 0, 0 ) )
		TranslateMessage( &Engine.Win.m_Msg );
		DispatchMessage( &Engine.Win.m_Msg );

	TerminateThread( Engine.Win.m_hCalcThread, 0 );



Its making the window as if it has a strange border and a menu when I clearly am not using a style with that and have set the menu names to NULL.

6 Years
Discussion Span
Last Post by VilePlecenta

No one has any idea why it would do this?

I went through my code disabling piece by piece to find the bad boy, It was caused by sending every message that my window received to another window.

Edited by VilePlecenta: n/a

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.