Solved

Dragging Gray Region over multiple windows

Posted on 1999-01-11
2
269 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
MFC Dialog 9 52
WinWaitActive parameters 12 31
changeXy challenge 13 93
Updating statistics with error notification email in SQL server 4 117
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
In this post we will learn different types of Android Layout and some basics of an Android App.
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…

685 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