Re: Find DesktopRegion in MFC VC++
- From: "Severian [MVP]" <severian@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Sat, 30 Apr 2005 21:37:27 GMT
On Sat, 30 Apr 2005 08:07:25 GMT, burt@xxxxxxxxxxxxxxxxx (Burt
Johnson) wrote:
>Not sure if this is the right group to ask this. If not, please direct
>me to where this stuff is discussed.
>
>I am working on a commercial application, and recently discovered a bug
>I have been asked to fix (they threw it back in my lap).
>
>Run the application on a 2-monitor system, such as a laptop in a dock
>with an external monitor. Drag the main window to the second
>(non-taskbar) window and quit. Now move the laptop to a different dock
>with the second menu on the other side (or without a second monitor at
>all) and launch the app.
>
>Oops. The app continues to want to go on the side it was last put, even
>though there is now no monitor there. (Yes, my dock in the office and at
>home have the second monitor on the opposite side, which is how I found
>the problem.)
>
>On the Macintosh, there is a concept of a "desktop grey region" that can
>be gotten, and an intersection of any particular window done. If the
>two do not intersect, the program knows to move ot the main window. I
>am pretty sure the same concept exists in MFC, as I see Excel and
>Outlook doing this switch when I move from office to home.
>
>How do I go about getting that region in MFC, and how do I ask the
>intersection with my window that I just opened?
>
>As you can probably tell, I'm pretty new to MFC. Just completed my 4th
>week using it... :-)
This is a very common problem with applications; since rearranging my
two monitors, I still have to occasionally use Alt+Space, M and move a
window into the visible area.
My applications retrieve the desktop region and create a region from
the application window rectangle. If the intersection of these is not
the app window, then some part of the application is not visible, in
which case I place it at the default position.
Unfortunately, I'm not very familiar with MFC, but you should be able
to use the CRgn (CRegion?) functions to do what you want.
--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real, but please post replies on the newsgroup.
.
- Follow-Ups:
- Re: Find DesktopRegion in MFC VC++
- From: Burt Johnson
- Re: Find DesktopRegion in MFC VC++
- Next by Date: Off topic - looking for a good recruiter in Houston
- Next by thread: Re: Find DesktopRegion in MFC VC++
- Index(es):
Relevant Pages
|
Loading