⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 child_popup.shtml.htm

📁 mfc资料集合5
💻 HTM
字号:
<HTML>
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Zafir Anjum">
   <TITLE>Miscellaneous - Change from child window to popup window (and back)</TITLE>
</HEAD>
<body background="../fancyhome/back.gif" tppabs="http://www.codeguru.com/fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000" bgproperties="fixed">
<table WIDTH="100%">
<tr WIDTH="100%">
<td><A HREF="http://209.66.99.126/cgi/ads.cgi?advert=myad2"><IMG SRC="../../209.66.99.126/advertise2.gif" tppabs="http://209.66.99.126/advertise2.gif" ALT="" BORDER=2></A><td>
</tr>
</table>


<CENTER>
<H3>
<FONT COLOR="#AOAO99">Change from child window to popup window (and back)</FONT></H3></CENTER>

<HR>




This article was contributed by <A HREF="mailto:>hou@tfn.com">Bing Hou</A>.






<P> A window can be created as either a child or a popup. A child window 
 can be moved only within its parent's rectangle area. Let's say one 
 wants to do just the opposite, that is, to move a child window out of 
 its parent's area, it is hard to switch its style without destroying 
 and creating a new one. That is the original motivation for creating 
 the CPopChildWnd.
 
<P> CPopChildWnd is based on MFC's CWnd class, it actually uses two CWnd 
 derivatives(one is created as child and the other as a popup) to give 
 the appearence of its switchable style. To use it, user embeds a 
 CPopChildWnd(or often time, its derivative) as a data member, and call 
 its Create(...) function. When CPopChildWnd's create function is 
 called, it creates two windows, as mentioned before, one is visible 
 and the other is hidden. User then will be able to drag the window 
 around by mouse, when it is in the parent's rectangle area, it is a 
 child(actually the child window is shown), when it is outside of the 
 parent's area, it is a popup window(the popup window shown). Because 
 the drawing stuff is all handled by CPopChildWnd itself, therefore the 
 two switchable windows appear to be the same.
 
<P> I used it first as a hot-spot picture, where a portion of a view 
 window's drawing is movable by mouse dragging, if you double-click(or 
 right click) that portion, some action will take place. If you drag 
 that portion out of the view window, it dangles on the desktop, yet it 
 still is a hot-spot.
 
<P> I also used it as a banner where some text and graphs were shown, user 
 can move that banner out of the way to have more screen real estate to 
 work with still be able to see the banner.
 
<P> I can also imagine it be used as some sort of short cut bar where user 
 can conveniently place it anywhere on the desktop.


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -