We help IT Professionals succeed at work.
Get Started

Minimize and Hide an application without animations?

Mamouri
Mamouri asked
on
1,556 Views
Last Modified: 2010-04-05
Hello Experts!
I use following code for taking capture from screen:
var
  ScreenDC: HDC;
  ABitmap: TBitmap;
begin
  Hide;
  ABitmap := TBitmap.Create;
  ScreenDC := 0;
  try
    ABitmap.PixelFormat := pf24bit;

    ABitmap.Width := Screen.Width;
    ABitmap.Height := Screen.Height;
    ScreenDC := GetDC(0);
    BitBlt(ABitmap.Canvas.Handle, 0, 0, ABitmap.Width, ABitmap.Height, ScreenDC, 0, 0, SRCCOPY);
    Image1.Picture.Bitmap := ABitmap;
  finally
    ABitmap.Free;
  end;
  Show;

As you see in First Line I hided main window to prevent of capturing my program itself.

But Because Hiding a window in taskbar in Windows XP (that have special animation) take long, a picture of my program in task bar also captured.

you can try yourself, this code. the program itself (in taskbar) also included in final program.

Does somebody know a way to disable effects of minimize and hiding JUST FOR MY PROGRAM?

Or Does somebody can suggest other solution to preventig that?

Thankx
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 2 Answers and 24 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE