Get TaskBar handle

用一個未公開的API

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; 

你可能感兴趣的:(Get TaskBar handle)