Модераторы: Snowy, bartram, MetalFan, bems, Poseidon, Riply
  

Поиск:

Ответ в темуСоздание новой темы Создание опроса
> Кто владелец taskbar buttons (NT)? 
:(
    Опции темы
Poseidon
Дата 19.5.2005, 03:53 (ссылка) | (нет голосов) Загрузка ... Загрузка ... Быстрая цитата Цитата


Delphi developer
****


Профиль
Группа: Комодератор
Сообщений: 5273
Регистрация: 4.2.2005
Где: Гомель, Беларусь

Репутация: 10
Всего: 133



Код

  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:[email protected], 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; 



--------------------
Если хочешь, что бы что-то работало - используй написанное, 
если хочешь что-то понять - пиши сам...
PM MAIL ICQ   Вверх
  
Ответ в темуСоздание новой темы Создание опроса
Правила форума "Delphi: WinAPI и системное программирование"
Snowybartram
MetalFanbems
PoseidonRrader
Riply

Запрещено:

1. Публиковать ссылки на вскрытые компоненты

2. Обсуждать взлом компонентов и делиться вскрытыми компонентами

  • Литературу по Delphi обсуждаем здесь
  • Действия модераторов можно обсудить здесь
  • С просьбами о написании курсовой, реферата и т.п. обращаться сюда
  • Вопросы по реализации алгоритмов рассматриваются здесь
  • 90% ответов на свои вопросы можно найти в DRKB (Delphi Russian Knowledge Base) - крупнейшем в рунете сборнике материалов по Дельфи
  • 99% ответов по WinAPI можно найти в MSDN Library, оставшиеся 1% здесь

Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Snowy, bartram, MetalFan, bems, Poseidon, Rrader, Riply.

 
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей)
0 Пользователей:
« Предыдущая тема | Delphi: WinAPI и системное программирование | Следующая тема »


 




[ Время генерации скрипта: 0.0387 ]   [ Использовано запросов: 22 ]   [ GZIP включён ]


Реклама на сайте     Информационное спонсорство

 
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности     Powered by Invision Power Board(R) 1.3 © 2003  IPS, Inc.