Solved

Having Problems with AnimateWindow

Posted on 2004-09-28
5
400 Views
Last Modified: 2013-11-20
hi

  I want to hide my application on certain conditions when the
application is minimized. Till now i was using ShowWindow to achieve
this and it worked fine. Now when I am using the AnimateWindow API the
window gets hidden but the window's entry in the taskbar remains. I am
posting the code that i have written.

void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
  if ((nID & 0xFFF0) == SC_MINIMIZE)
  {
    if(bMinimizeToTray)
    {
      this->AnimateWindow(200,AW_HIDE |AW_SLIDE | AW_VER_POSITIVE);
     // this->ShowWindow(SW_HIDE);
      return;
    }
  }

 CFrameWnd::OnSysCommand(nID, lParam);

rollocool
0
Comment
Question by:rollocool
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
5 Comments
 
LVL 48

Expert Comment

by:AlexFM
ID: 12167333
What happens if you uncomment line ShowWindow(SW_HIDE) ?
0
 
LVL 1

Author Comment

by:rollocool
ID: 12167768
hi

 Doesn't make any difference whether i comment or uncomment the ShowWindow(SW_HIDE) line.

0
 
LVL 1

Author Comment

by:rollocool
ID: 12186975
i solved the problem myself

 void CMainFrame::OnSysCommand(UINT nID, LPARAM lParam)
{
  if ((nID & 0xFFF0) == SC_MINIMIZE)
  {
    if(bMinimizeToTray)
    {
      this->AnimateWindow(200,AW_HIDE |AW_SLIDE | AW_VER_POSITIVE);
// added these 2 lines
      this->ShowWindow(SW_MINIMIZE);
      this->ShowWindow(SW_HIDE);
      return;
    }
  }

 CFrameWnd::OnSysCommand(nID, lParam);

rollocool

0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12220293
Question answered by asker or dialog valuable.
Closed, 100 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

623 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