Win32 Question

Started by
17 comments, last by jflanglois 18 years, 5 months ago
I recently added an option to allow for a windowed mode during the window creation, but I cant seem to figure out how to make the window mobile. So that you can use the mouse to drag the window around the screen. I have looked over all the params for CreateWindowEx() carefully, and I dont see anything there, I even commented out all my mouse processing so the defaultWindowProc() function could take that, still cant move the window around. What else should I look at? Im happy to post any code you think may be relavant.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Advertisement
The easiest, I suppose, would be to pass WS_OVERLAPPEDWINDOW to the dwstyle parameter of CreateWindow(Ex). Take a look at Window styles.


jfl.
Currently im using these styles.

xs is the dwExstyle
s is the dwstyle

	if(windowMode == FULLSCREEN) {		s = WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;		xs = WS_EX_APPWINDOW;	}	else {		s = WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;		xs = WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;	}
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Could you be more specific on the problem? How is the window not able to move? Is it that the title bar is not showing up? Or does the mouse not do anything when you drag?


jfl.
Quote:Original post by jflanglois
Could you be more specific on the problem? How is the window not able to move? Is it that the title bar is not showing up? Or does the mouse not do anything when you drag?


jfl.



The window has a title bar and buttons, there is no cursor when the mouse is over the window, which has not been an issue since I have always just rendered the cursor. My WNDCLASS object is this.

	wc.cbClsExtra =		0;	wc.cbWndExtra =		0;	wc.hbrBackground =	NULL;	wc.hCursor =		LoadCursor(NULL, IDC_ARROW);	wc.hIcon =		LoadIcon(NULL, IDI_WINLOGO);	wc.hInstance =		hin;	wc.lpfnWndProc =	WindowProc;	wc.lpszClassName =	WINDOW_INSTANCE_NAME;	wc.lpszMenuName =	NULL;	wc.style =		CS_HREDRAW | CS_VREDRAW | CS_OWNDC;

www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
Are you using directinput for the mouse?


jfl.
What does the message handler look like? You may not be calling the default window proc and so the messages that you don't handle are never handled.
Quote:Original post by ProgramMax
What does the message handler look like? You may not be calling the default window proc and so the messages that you don't handle are never handled.


LRESULT CALLBACK WindowProc(HWND p_hwn,UINT p_msg,WPARAM p_wparam,LPARAM p_lparam) {	return GameClient->ProcessIO(&p_hwn, &p_msg, &p_wparam, &p_lparam);}LRESULT CALLBACK cGameClient::ProcessIO(HWND* p_hwn,UINT* p_msg,WPARAM* p_wparam,LPARAM* p_lparam) {	switch(*p_msg) {		case WM_ACTIVATE:			if(!HIWORD(*p_wparam)) 				active = true;			else 				active = false;			return 0;		case WM_SYSCOMMAND:			switch (*p_wparam)			{				case SC_SCREENSAVE:				case SC_MONITORPOWER:					return 0;			}			return 0;			case WM_KEYDOWN:			keys[*p_wparam] = true;				Keyboard((unsigned short)*p_wparam);			return 0;		case WM_KEYUP:			keys[*p_wparam] = false;			return 0;		case WM_QUIT:		case WM_CLOSE:			running = false;			return 0;	}	return DefWindowProc(*p_hwn, *p_msg, *p_wparam, *p_lparam);}
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.
My guess is, from the info at hand:
Change IDirectInputDevice8::SetCooperativeLevel to DISCL_BACKGROUND | DISCL_NONEXCLUSIVE

[edit] Is cGameClient::ProcessIO a static member function?



jfl.
Quote:Original post by jflanglois
My guess is, from the info at hand:
Change IDirectInputDevice8::SetCooperativeLevel to DISCL_BACKGROUND | DISCL_NONEXCLUSIVE

[edit] Is cGameClient::ProcessIO a static member function?



jfl.


Im not using Directinput, nor do I have any DirectX SDK.

[edit] no. If I make it static i got a ton of errors.
www.EberKain.comThere it is, Television, Look Listen Kneel Pray.

This topic is closed to new replies.

Advertisement