Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Having Problems with AnimateWindow

Posted on 2004-09-28
5
Medium Priority
?
404 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

722 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