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

•  TDictionary Custom Sort  3 223

•  Fast Watermark Sources  2 989

•  3D Designer  4 750

•  Sik Screen Capture  3 259

•  Patch Maker  3 466

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

•  ListBox Drag & Drop  2 903

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

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

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

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

•  Canvas Drawing  2 671

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

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

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

•  Paint on Shape  1 522

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

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

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

•  Пазл Numbrix  1 649

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

•  Игра HIP  1 261

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

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

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

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

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

•  HEX View  1 465

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

•  Задача коммивояжера  1 356

 
скрыть


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

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



Delphi Sources

Получить дескриптор окна, которое владеет кнопками запущенных программ на панели задач



Оформил: DeeCo

{ 
  In this article, I wish to describe the useful undocumented function 
  GetTaskmanWindow. The GetTaskmanWindow function returns a handle to 
  the window that ownes the taskbar buttons. 
  Here is the quoting about taskbar from Microsoft MSDN: 
  "The Microsoft® Windows® interface includes a special application desktop 
  toolbar called the taskbar. 
  The taskbar can be used for such tasks as switching between open 
  windows and starting new applications..." 
  and "The taskbar includes the Start menu, taskbar buttons, 
  a shortcut menu, and a status area...". 
  Unfortunately, Win32 API doesn't contain documented 
  function that can be used for accessing to the 
  taskbar so we should again use an undocumented way. 

  Here is the prototype for GetTaskmanWindow: 

   function GetTaskmanWindow (): HWND; 

  As always, Microsoft doesn't provide us with the exports symbols 
  in the User32.lib for this function, so we should load them dynamically using the 
  GetProcAddress and GetModuleHandle functions: 
}

 // getaskmanwnd.cpp (Windows NT/2000) 
// 
// This example will show you how you can obtain a handle to the 
// Windows Taskbar window. 
// Translated from C to Delphi by Thomas Stutz 
// Original Code: 
// (c)1999 Ashot Oganesyan K, SmartLine, Inc 
// mailto:ashot@aha.ru, http://www.protect-me.com, http://www.codepile.com 


function TaskmanWindow: HWND;
 type
   TGetTaskmanWindow = function(): HWND; stdcall;
 var
   hUser32: THandle;
   GetTaskmanWindow: TGetTaskmanWindow;
 begin
   Result := 0;
   hUser32 := GetModuleHandle('user32.dll');
   if (hUser32 > 0) then
   begin
     @GetTaskmanWindow := GetProcAddress(hUser32, 'GetTaskmanWindow');
     if Assigned(GetTaskmanWindow) then
     begin
       Result := GetTaskmanWindow;
     end;
   end;
 end;

 procedure ShowTaskmanWindow(bValue: Boolean);
 var
   hTaskmanWindow: Hwnd;
 begin
   hTaskmanWindow := TaskmanWindow;
   if hTaskmanWindow <> 0 then
   begin
     ShowWindow(GetParent(hTaskmanWindow), Ord(bValue));
   end;
 end;

 // Example to Hide the Taskman Window 
procedure TForm1.Button1Click(Sender: TObject);
 begin
   ShowTaskmanWindow(False);
 end;




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

Список запущенных процессов

Модуль активации программ

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

Задача «Иосифа Флавия»

 

Задача коммивояжера




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

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