Solved

Having Problems with AnimateWindow

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mixString challenge 36 137
Separate into files by filename 12 92
wordmultiple challenge 12 170
c++  placing data into a form and an editbox 5 49
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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

739 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