Недавно добавленные исходники

•  DeLiKaTeS Tetris (Тетрис)  159

•  TDictionary Custom Sort  3 336

•  Fast Watermark Sources  3 087

•  3D Designer  4 846

•  Sik Screen Capture  3 340

•  Patch Maker  3 552

•  Айболит (remote control)  3 657

•  ListBox Drag & Drop  3 014

•  Доска для игры Реверси  81 692

•  Графические эффекты  3 944

•  Рисование по маске  3 248

•  Перетаскивание изображений  2 628

•  Canvas Drawing  2 751

•  Рисование Луны  2 579

•  Поворот изображения  2 188

•  Рисование стержней  2 168

•  Paint on Shape  1 568

•  Генератор кроссвордов  2 235

•  Головоломка Paletto  1 767

•  Теорема Монжа об окружностях  2 229

•  Пазл Numbrix  1 685

•  Заборы и коммивояжеры  2 057

•  Игра HIP  1 282

•  Игра Go (Го)  1 230

•  Симулятор лифта  1 475

•  Программа укладки плитки  1 216

•  Генератор лабиринта  1 548

•  Проверка числового ввода  1 365

•  HEX View  1 497

•  Физический маятник  1 358

 
скрыть


Delphi FAQ - Часто задаваемые вопросы

| Базы данных | Графика и Игры | Интернет и Сети | Компоненты и Классы | Мультимедиа |
| ОС и Железо | Программа и Интерфейс | Рабочий стол | Синтаксис | Технологии | Файловая система |



Delphi Sources

Вылет окна 2



Оформил: DeeCo

{ 
  A lot of Windows applications show a nice zooming animation when they 
  minimize/maximize their windows. Ofcourse you can do this too! 
  Microsoft provides the DrawAnimatedRects() function for this purpose and I'll 
  show you how to use it. 

  As an example I'll show how to show an animation that you can use to minimize 
  your application to the system tray area. This example doesn't actually minimize 
  the application, it only shows the animation. 

  First create a new application and put a button on the form. Use the following 
  OnClick-handler for the button: 
}

 procedure TForm1.Button1Click(Sender: TObject);
 var
   FormRect, TrayRect: TRect;
   hTray: THandle;
 begin
   // Get handle of tray window 
  hTray := FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0,'TrayNotifyWnd', nil);

   if hTray <> 0 then
    begin
     // This is the source rect for the animation. 
    FormRect := BoundsRect;

     // Get tray window's coordinates as a TRect. This will be the animation's destination rect. 
    GetWindowRect(hTray, TrayRect);

     { 
      Now perform the actual animation. Note that this code only shows the 
      animation. It does NOT minimize this application to the tray. I leave 
      that up to yourself ;-) 

      Also notice that the Delphi Help documents are very wrong about this 
      function! Use the official MSDN docs located Microsoft's website. 
      Instead of IDANI_CAPTION you can also use IDANI_OPEN and IDANI_CLOSE, but 
      they don't seem to do anything... Maybe they are for future use? 
    }
     if not DrawAnimatedRects(Handle, IDANI_CAPTION, FormRect, TrayRect) then
      begin
       MessageDlg('DrawAnimatedRects() failed!', mtError, [mbOK], 0);
     end;
   end
    else
    begin
     MessageDlg('Can''t get tray window handle!', mtError, [mbOK], 0);
   end;
 end;




Похожие по теме исходники

Посторонние окна WinAPI




Copyright © 2004-2024 "Delphi Sources" by BrokenByte Software. Delphi World FAQ

Группа ВКонтакте