why do you all cry: it doesn't work, it doesn't work! it works, change those (really) small 5 pixels to 20 and see!
this sample works on all windows platforms, there isn't any win2k-specific code in it. you can even do this with visual basic (which is almost always compatible to win3.1!).
so be quiet and blame yourself, or try to get it working!
ps: go to aac.net.tf for the best audio grabber, written in vb!
I'm looking for a long time for a tool that will allow all application of windows to snap on the edges and together.
This could be achieved by tracking the windows resizing and moving at the mouse level.
When you're resizing a window, by example, your "customised mouse driver" must then see that you're reaching the edge of another application (or the border of the screen) and speed up your mouse to make it snap.
It must'nt be hard to do but I haven't got time to do MFC programming now ...
If you make it, tell me about it !!! :o)
Come on people. It does work, it's just that it has a very low threshold. Some of you don't even know what it's SUPPOSED to do. What it does is to SNAP the window to the edge of the screen when you move it close enough. I'm sure you've seen this enough times in other places...
Try running the program. Then shrink the window somewhat, it makes it easier to see. Then move the window near to the edge of the screen. Now SLOWLY move it closer and closer to the edge of the screen. When you get close enough, the window will jump to align itself with the edge. Move the window off screen and move it's edge back close to the screen-edge and it does the same.
If you still don't see it, open the workspace, and change the line in SnapWnd.cpp from
m_nSnapPixels = 5;
m_nSnapPixels = 50;
rebuild and run it. You CAN'T miss it now.
To Anish, good job. It works properly and it even works when you resize the window even when it's attached. I made a similar thing last year with the help of Christian Weiske <firstname.lastname@example.org>. We eventually got it working and I couldn't have been happier. Good work.