Solved

Dragging Gray Region over multiple windows

Posted on 1999-01-11
2
267 Views
Last Modified: 2013-12-26
I have a "parent" index window which contains three "child" windows: a left pane, a right pane, and a divider pane.  I want the user to be able to mouse-click on the divider pane, drag a gray region of the divider pane anywhere over all three of the "child" windows, release the mouse button, and then have all "child" windows reposition themselves.  I have everything working except for dragging the Gray region over multiple windows.  How can this be done?  DragGrayRgn() does not seem to suffice as it only drags within one window.  I am dragging in the content area of the "parent" window which is covered up by the "child" windows.  How can I see the Dragged region while at the same time showing my "child" windows?  Please Help!
0
Comment
Question by:osibrian
2 Comments
 
LVL 2

Accepted Solution

by:
roov earned 100 total points
ID: 1291704
The easiest way would probably be to track the dragging your self (using StillDown() ).

This code is the skeleton, let me know if you need more...
Point mouseLoc, lastMouseLoc = {-1,-1};
while (::StillDown()) {
      ::GetMouse(&mouseLoc);
      if ((mouseLoc.h != lastMouseLoc.h) ||
            (mouseLoc.v != lastMouseLoc.v))
      {
            // we moved...
            lastMouseLoc = mouseLoc;
            
            // undraw previous region (using xor mode...)
            
            // draw new region, using xor mode...                  
      }
}

0
 

Author Comment

by:osibrian
ID: 1291705
The better solution I found was to Create a Graphics Port (not a Window) the same size as the Entire Desktop under the menu bar. (See GetGrayRgn()). Then I copy some of the info from GetGrayRgn() into my new Graphics Port.  Once this is done, I can use DragGrayRgn() to accomplish the task of dragging my Gray Region over any number of windows at once.  The effect is just what I wanted.  If any of you would like the same code for doing this, send me an E-mail.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Shell script to login to remote m/c and execute commands 10 78
tripleUp challenge 7 78
unix example issues 18 89
Problem to open Excel file 15 128
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now