Jump to content
  • Advertisement
Sign in to follow this  
LHLaurini

How to get mouse input from extended frame?

This topic is 1191 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 have a window which has a extended frame. It looks like this:

fYpXu.png

 

I've followed all steps in MSDN's guide for extended frames: Custom Window Frame Using DWM.

 

But the problem is: I can't capture mouse movement over the extended frame. I don't receive the WM_MOUSEMOVE message, and WM_NCMOUSEMOVE is only received on the resize area and on the top part of the extended frame, which is not what I need.

 

I've already tried SetCapture but it doesn't allows me to minimize, maximize, close, move nor resize the window, not to mention that it shows the "Working..." cursor.

 

Does someone knows how to solve this?

Share this post


Link to post
Share on other sites
Advertisement

Almost sounds like your window proc is attached to the wrong window.

 

Couldn't be. All other messages work fine.

Share this post


Link to post
Share on other sites

You're describing a lot of messages not working fine, though, and they're all associated with the top-level window. Are you sure that the proc isn't somehow attached to the interior window where the rendering is going on?

Share this post


Link to post
Share on other sites

You're describing a lot of messages not working fine, though, and they're all associated with the top-level window. Are you sure that the proc isn't somehow attached to the interior window where the rendering is going on?

 

What I wanted to say with "I've already tried SetCapture but it doesn't allows me to minimize, maximize, close, move nor resize the window, not to mention that it shows the "Working..." cursor." is that those messages don't work only when I use SetCapture. When I don't use SetCapture all these messages work fine.

 

PS: Either way, thanks for your answer.

Edited by LHLaurini

Share this post


Link to post
Share on other sites

All I can think of is that the proc could be malformed or else messages are just getting sent to the wrong window somehow. Do you get mousemoves when you use SetCapture?

 

Actually, if you're getting a busy cursor then that suggests that messages aren't being handled and the queue is backing up.

 

In any case, can you post the relevant code sections (proc, winclass, etc)?

Share this post


Link to post
Share on other sites
Wild guess here, are you doing the hit testing that extended frames require? Your mention of not being able to minimize or resize and such sounds suspiciously like the following quote from the page you linked:

A side effect of removing the standard frame is the loss of the default resizing and moving behavior. For your application to properly emulate standard window behavior, you will need to implement logic to handle caption button hit testing and frame resizing/moving.


By extending the frame you basically have to take over some of the tasks that Windows used to do for you automatically, because you've told Windows "It's ok, I've got this, I want to paint stuff myself".

Share this post


Link to post
Share on other sites

All I can think of is that the proc could be malformed or else messages are just getting sent to the wrong window somehow. Do you get mousemoves when you use SetCapture?
 
Actually, if you're getting a busy cursor then that suggests that messages aren't being handled and the queue is backing up.
 
In any case, can you post the relevant code sections (proc, winclass, etc)?

 

I think I'm going to create a child window in that part of the main window. That sould do the trick.

 

 

Wild guess here, are you doing the hit testing that extended frames require? Your mention of not being able to minimize or resize and such sounds suspiciously like the following quote from the page you linked:
 

A side effect of removing the standard frame is the loss of the default resizing and moving behavior. For your application to properly emulate standard window behavior, you will need to implement logic to handle caption button hit testing and frame resizing/moving.


By extending the frame you basically have to take over some of the tasks that Windows used to do for you automatically, because you've told Windows "It's ok, I've got this, I want to paint stuff myself".

 

 

Yes, I am. It works if I don't use SetCapture.

Edited by LHLaurini

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!