MSN Message Window
Site Map Feedback

Download:

Up Controls Files Moving Data

This is the tidiest attempt at a tool-tip message window grow unobtrusively out of the Taskbar Icon tray. The code demonstrates how to find the position of the Task Bar and control three timers as well as the window animation.

All you do in your Dialog/View header is add #include "MsgWnd.h" to the top and add CMsgWnd MsgWnd; to the private or protected section.
In the OnInitDialog() or OnInitialUpdate() you can add any of the following lines:
  MsgWnd.SetOwner(this); // The MsgWnd will now send Notify Messages to 'this' CWnd. If you don't need to know if the user clicked the MsgWnd, then don't have this line!
  MsgWnd.SetAVI(IDR_eMailAnimation); // This isn't necessary, but illustrates the method.
Then use ClassWizard to add an OnNotify handler and make it look like this:
BOOL CMsgWndDlg::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult) {
  if(MsgWnd.Clicked(lParam)) {
    SetFocus();

    MsgWnd.Show("You clicked?"); // This line is just for debug feedback

    return TRUE;
  }
  return CDialog::OnNotify(wParam, lParam, pResult);
}
There is also:
    MsgWnd.ShowDelayed("Message", 1000);
which starts showing the window after the specified number of milliseconds (showDelayed defaults to 100ms).

This class uses HandCursor.h


THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.