Solved

Having Problems with AnimateWindow

Posted on 2004-09-28
5
361 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
  • 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Detect CR LF to each line 12 137
MaxSpan challenge 9 67
Problem to event 3 50
Making an alias 7 52
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

706 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now