I have this code:

HWND handle = CreateWindowExA(0,name,name,
		0x13D,0x86, // x y
		0x320,0x258, // width height

But my window's name only contains one letter oO My final window name is "W"...

what am I doing wrong?

It's pretty difficult to say since you don't tell us what type "name" is or what value it contains. I also notice that you're using the same variable for the window class and the window title. Is this what you intended?

There's nothing wrong with the call itself, though I wonder why you're calling the ANSI version explicitly. How is the window class registered?

	wc.cbSize = sizeof(WNDCLASSEX);
	wc.cbClsExtra = 0;
	wc.lpfnWndProc = (WNDPROC)0x414820;
	wc.cbWndExtra = 0;
	HICON icon = LoadIconA(hInst,(LPCSTR)111);
	wc.hIcon = icon;
	wc.hIconSm = icon;
	wc.hCursor = LoadCursor(NULL,IDC_ARROW);
	wc.hbrBackground =(HBRUSH)GetStockObject(BLACK_BRUSH);
	wc.lpszMenuName = NULL;
	wc.lpszClassName = TEXT("Window");

I'm using VS 2010, but it works fine with C++ 6.0 or DevC++. But I dont want to use them.

Edited 5 Years Ago by lelejau: n/a

This question has already been answered. Start a new discussion instead.