Jump to content
  • Advertisement
Sign in to follow this  
Eber Kain

Win32 Question

This topic is 4616 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

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.

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!