Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

10 Minutes to document your code

, 19 Jan 2003
Setting up doxygen, a free tool to document your code, in a few simple steps.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>SNAPINFO struct Reference</TITLE>
<META http-equiv=Content-Type content=text/html;charset=iso-8859-1><LINK 
href="samplefull_noall_files/doxygen.css" type=text/css rel=stylesheet>
<META content="MSHTML 6.00.2715.400" name=GENERATOR></HEAD>
<BODY><!-- Generated by Doxygen 1.3-rc2 -->
<CENTER><A class=qindex 
href="file:///E:/C/pub/mdisnap/project/doxydoc/main.html">Main Page</A> &nbsp; 
<A class=qindex 
href="file:///E:/C/pub/mdisnap/project/doxydoc/classes.html">Alphabetical 
List</A> &nbsp; <A class=qindex 
href="file:///E:/C/pub/mdisnap/project/doxydoc/annotated.html">Data 
Structures</A> &nbsp; <A class=qindex 
href="file:///E:/C/pub/mdisnap/project/doxydoc/files.html">File List</A> &nbsp; 
<A class=qindex 
href="file:///E:/C/pub/mdisnap/project/doxydoc/functions.html">Data Fields</A> 
&nbsp; </CENTER>
<HR>

<H1>SNAPINFO Struct Reference</H1><CODE>#include &lt;<A class=el 
href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8h-source.html">MDISnapper.h</A>&gt;</CODE> 

<P>
<HR>
<A name=_details></A>
<H2>Detailed Description</H2>holds the data for calculating a modified window 
rect. 
<P>Since it only works on coordinate rects, it can be used without any actual 
Windows. To use it:
<UL>
  <LI>call Init, specifying the initial position
  <LI>call SnapHLine / SnapVLine for each (virtual) line to snap to
  <LI>call EndSnap to retrieve the final position </LI></UL>
<P>
<P>Definition at line <A class=el 
href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8h-source.html#l00021">21</A> 
of file <A class=el 
href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8h-source.html">MDISnapper.h</A>.
<TABLE cellSpacing=0 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD></TD></TR>
  <TR>
    <TD colSpan=2><BR>
      <H2>Public Methods</H2></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right>void&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a0">Init</A> 
      (RECT const &amp;oldRect, RECT const &amp;newRect, DWORD snapwidth)</TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>Initialize, specifying a pre-move and post-move 
      rect.</EM> <A 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a0"></A><EM></EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right>void&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a1">Init</A> 
      (RECT const &amp;r, DWORD <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#m0">snapWidth</A>, 
      bool moveOnly=false)</TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>Initialize, specifying only one rectangle.</EM> <A 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a1"></A><EM></EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right>void&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a2">SnapHLine</A> 
      (long y)</TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>snap to a horizontal line</EM> <A 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a2"></A><EM></EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right>void&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a3">SnapVLine</A> 
      (long x)</TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>snap to a vertical line</EM> <A 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a3"></A><EM></EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right><A name=a4 
      doxytag="SNAPINFO::EndSnap"></A>RECT &amp;&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#a4">EndSnap</A> 
      ()</TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>ends snapping sequence and returns final 
      coords</EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD colSpan=2><BR>
      <H2>Data Fields</H2></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right><A name=m0 
      doxytag="SNAPINFO::snapWidth"></A>DWORD&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#m0">snapWidth</A></TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>distance over which snapping 
      works</EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right><A name=m1 
      doxytag="SNAPINFO::rold"></A>RECT&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#m1">rold</A></TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>original rect</EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right><A name=m2 
      doxytag="SNAPINFO::rnew"></A>RECT&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#m2">rnew</A></TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>post-move rect (if 
  specified)</EM></FONT><BR><BR></TD></TR>
  <TR>
    <TD vAlign=top noWrap align=right><A name=m4 
      doxytag="SNAPINFO::rout"></A>RECT&nbsp;</TD>
    <TD vAlign=bottom><A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/structSNAPINFO.html#m4">rout</A></TD></TR>
  <TR>
    <TD>&nbsp;</TD>
    <TD><FONT size=-1><EM>accumulates the final 
  rect</EM></FONT><BR><BR></TD></TR></TBODY></TABLE>
<HR>

<H2>Member Function Documentation</H2><A name=a0 doxytag="SNAPINFO::Init"></A>
<P>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=md>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD class=md vAlign=top noWrap>void SNAPINFO::Init </TD>
          <TD class=md vAlign=top>(&nbsp;</TD>
          <TD class=md vAlign=top noWrap>RECT const &amp;&nbsp;</TD>
          <TD class=mdname noWrap>&nbsp; <EM>oldRect</EM>, </TD></TR>
        <TR>
          <TD></TD>
          <TD></TD>
          <TD class=md noWrap>RECT const &amp;&nbsp;</TD>
          <TD class=mdname noWrap>&nbsp; <EM>newRect</EM>, </TD></TR>
        <TR>
          <TD></TD>
          <TD></TD>
          <TD class=md noWrap>DWORD&nbsp;</TD>
          <TD class=mdname noWrap>&nbsp; <EM>snapwidth</EM></TD></TR>
        <TR>
          <TD></TD>
          <TD class=md>)&nbsp;</TD>
          <TD class=md colSpan=2></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=5 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD>&nbsp; </TD>
    <TD>
      <P>Initialize, specifying a pre-move and post-move rect. 
      <P>use this method if the window is about to be moved or resized (e.g. in 
      WM_SIZING or WM_MOVING handler) 
      <DL compact>
        <DT><B>Parameters:</B>
        <DD>
        <TABLE cellSpacing=2 cellPadding=0 border=0>
          <TBODY>
          <TR>
            <TD vAlign=top><EM>oldRect</EM>&nbsp;</TD>
            <TD>Location of the window before being moved </TD></TR>
          <TR>
            <TD vAlign=top><EM>newRect</EM>&nbsp;</TD>
            <TD>new location of the window </TD></TR>
          <TR>
            <TD vAlign=top><EM>snapwidth</EM>&nbsp;</TD>
            <TD>"catch range" in pixels </TD></TR></TBODY></TABLE></DD></DL>
      <P>Definition at line <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html#l00040">40</A> 
      of file <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html">MDISnapper.cpp</A>. 
      </P></TD></TR></TBODY></TABLE><A name=a1 doxytag="SNAPINFO::Init"></A>
<P>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=md>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD class=md vAlign=top noWrap>void SNAPINFO::Init </TD>
          <TD class=md vAlign=top>(&nbsp;</TD>
          <TD class=md vAlign=top noWrap>RECT const &amp;&nbsp;</TD>
          <TD class=mdname noWrap>&nbsp; <EM>r</EM>, </TD></TR>
        <TR>
          <TD></TD>
          <TD></TD>
          <TD class=md noWrap>DWORD&nbsp;</TD>
          <TD class=mdname noWrap>&nbsp; <EM>snapwidth</EM>, </TD></TR>
        <TR>
          <TD></TD>
          <TD></TD>
          <TD class=md noWrap>bool&nbsp;</TD>
          <TD class=mdname noWrap>&nbsp; <EM>moveOnly</EM> = false</TD></TR>
        <TR>
          <TD></TD>
          <TD class=md>)&nbsp;</TD>
          <TD class=md colSpan=2></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=5 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD>&nbsp; </TD>
    <TD>
      <P>Initialize, specifying only one rectangle. 
      <P>
      <DL compact>
        <DT><B>Parameters:</B>
        <DD>
        <TABLE cellSpacing=2 cellPadding=0 border=0>
          <TBODY>
          <TR>
            <TD vAlign=top><EM>r</EM>&nbsp;</TD>
            <TD>Location of the window </TD></TR>
          <TR>
            <TD vAlign=top><EM>snapwidth</EM>&nbsp;</TD>
            <TD>"catch range" in pixels </TD></TR>
          <TR>
            <TD vAlign=top><EM>moveOnly</EM>&nbsp;</TD>
            <TD>if true, the modified rectangle will have the same size as r 
            </TD></TR></TBODY></TABLE></DD></DL>
      <P>Definition at line <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html#l00067">67</A> 
      of file <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html">MDISnapper.cpp</A>. 
      </P></TD></TR></TBODY></TABLE><A name=a2 doxytag="SNAPINFO::SnapHLine"></A>
<P>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=md>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD class=md vAlign=top noWrap>void SNAPINFO::SnapHLine </TD>
          <TD class=md vAlign=top>(&nbsp;</TD>
          <TD class=md vAlign=top noWrap>long&nbsp;</TD>
          <TD class=mdname1 vAlign=top noWrap>&nbsp; <EM>y</EM> </TD>
          <TD class=md vAlign=top>)&nbsp;</TD>
          <TD class=md noWrap></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=5 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD>&nbsp; </TD>
    <TD>
      <P>snap to a horizontal line 
      <P>
      <DL compact>
        <DT><B>Parameters:</B>
        <DD>
        <TABLE cellSpacing=2 cellPadding=0 border=0>
          <TBODY>
          <TR>
            <TD vAlign=top><EM>y</EM>&nbsp;</TD>
            <TD>y-coordinate of the horizontal line to snap to 
        </TD></TR></TBODY></TABLE></DD></DL>
      <P>Definition at line <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html#l00122">122</A> 
      of file <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html">MDISnapper.cpp</A>. 
      </P></TD></TR></TBODY></TABLE><A name=a3 doxytag="SNAPINFO::SnapVLine"></A>
<P>
<TABLE cellSpacing=0 cellPadding=2 width="100%" border=0>
  <TBODY>
  <TR>
    <TD class=md>
      <TABLE cellSpacing=0 cellPadding=0 border=0>
        <TBODY>
        <TR>
          <TD class=md vAlign=top noWrap>void SNAPINFO::SnapVLine </TD>
          <TD class=md vAlign=top>(&nbsp;</TD>
          <TD class=md vAlign=top noWrap>long&nbsp;</TD>
          <TD class=mdname1 vAlign=top noWrap>&nbsp; <EM>x</EM> </TD>
          <TD class=md vAlign=top>)&nbsp;</TD>
          <TD class=md noWrap></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE cellSpacing=5 cellPadding=0 border=0>
  <TBODY>
  <TR>
    <TD>&nbsp; </TD>
    <TD>
      <P>snap to a vertical line 
      <P>
      <DL compact>
        <DT><B>Parameters:</B>
        <DD>
        <TABLE cellSpacing=2 cellPadding=0 border=0>
          <TBODY>
          <TR>
            <TD vAlign=top><EM>x</EM>&nbsp;</TD>
            <TD>x-coordinate of the vertical line to snap to 
        </TD></TR></TBODY></TABLE></DD></DL>
      <P>Definition at line <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html#l00084">84</A> 
      of file <A class=el 
      href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html">MDISnapper.cpp</A>. 
      </P></TD></TR></TBODY></TABLE>
<HR>
The documentation for this struct was generated from the following files:
<UL>
  <LI><A class=el 
  href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8h-source.html">MDISnapper.h</A>
  <LI><A class=el 
  href="file:///E:/C/pub/mdisnap/project/doxydoc/MDISnapper_8cpp-source.html">MDISnapper.cpp</A></LI></UL>
<HR>

<ADDRESS style="align: right"><SMALL>Generated on Sat Jan 18 22:13:03 2003 for 
testproject by <A href="http://www.doxygen.org/index.html"><IMG height=53 
alt=doxygen src="samplefull_noall_files/doxygen.png" width=110 align=middle 
border=0></A>1.3-rc2 </SMALL></ADDRESS></BODY></HTML>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

peterchen
Klippel
Germany Germany
Peter is tired of being called "Mr. Chen", even so certain individuals insist on it. No, he's not chinese.
 
Peter has seen lots of boxes you youngsters wouldn't even accept as calculators. He is proud of having visited the insides of a 16 Bit Machine.
 
In his spare time he ponders new ways of turning groceries into biohazards, or tries to coax South American officials to add some stamps to his passport.
 
Beyond these trivialities Peter works for Klippel[^], a small german company that wants to make mankind happier by selling them novel loudspeaker measurement equipment.
 

Where are you from?[^]



Please, if you are using one of my articles for anything, just leave me a comment. Seeing that this stuff is actually useful to someone is what keeps me posting and updating them.
Should you happen to not like it, tell me, too

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 20 Jan 2003
Article Copyright 2003 by peterchen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid