How to make a window moving handle (click and drag the handle to move the window)  
Author Message
Flame Thrower





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

I need to make an app with no borders/title bar (got that covered) that has a window moving handle (the form background) that moves the window when you click and drag it. If this puzzles you think of Windows Media Player in Skinned Mode.

Can Someone Please Help Me

Flame thrower



Visual C++15  
 
 
Martin Richter





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

You have to write a handler for the WM_NCHITTEST. For the area you want to allow to move the window you have to return HTCAPTION

 
 
Flame Thrower





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

code examples please


 
 
Martin Richter





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

:-/ And for what ATL/MFC/pure Win32

You have the keywords it should be a problem to search in the WEB.
But I believe that the solution is so easy that you wouldn't find a specific sample.

Here is a code that uses it:

http://msdn.microsoft.com/msdnmag/issues/02/12/CQA/



 
 
Flame Thrower





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

>>:-/ And for what ATL/MFC/pure Win32

C++/CLR


 
 
Martin Richter





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

Here is the basic in C#. Should be a problem for you to overwrite WndProc and insert the same code.

http://www.codeproject.com/cs/media/CsTranspTutorial3.asp



 
 
Flame Thrower





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

But i only know c++/clr/Windows Forms 2.0

not C Sharp


 
 
Martin Richter





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

Sry I can't understand you.

But the code is identical. You need to overwrite the same windows function like in C#, its the same code to compare the parameters and its the same code to return.

What is your problem



 
 
Flame Thrower





PostPosted: Visual C++ Language, How to make a window moving handle (click and drag the handle to move the window) Top

I tried puttin it in, VS gives me lots of syntax bull

must not be the same in c++...