![]() |
Move taskbar
Ok here we go i want to move the whole taskbar from 1280x30 cordinates(found by winspy 2008) to about 1280x80.But it looks like its not working i can change other stuff like tray,running applications etc.But not whole taskbar.Explain what i am doing wrong.
I currently got this code but it changes size of
Delphi-Quellcode:
var
MyHandle: THandle; WinRect: TRect; begin MoveWindow(FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, '', nil), 1280, 80, 80, 22, true); |
Re: Move taskbar
I'm not sure if your code snippet really finds the taskbar...
Take a look at this code (part of amaTaBaSo, OpenSource, use DelphiPraxis Search to locate the whole Sourcecode):
Delphi-Quellcode:
function GetToolbarWindowHandle:HWND;
var hDesktop : HWND; hTray : HWND; hReBar : HWND; hTask : HWND; hToolbar : HWND; begin hDesktop := GetDesktopWindow; hTray := FindWindowEx( hDesktop, 0, 'Shell_TrayWnd', nil ); hReBar := FindWindowEx( hTray, 0, 'ReBarWindow32', nil ); hTask := FindWindowEx( hReBar, 0, 'MSTaskSwWClass', nil ); hToolbar := FindWindowEx( hTask, 0, 'ToolbarWindow32', nil ); if ( hToolbar = 0 ) then MessageDlg( 'Taskbar konnte nicht gefunden werden', mtError, [mbOK], 0); Result := hToolbar; end; |
Re: Move taskbar
Liste der Anhänge anzeigen (Anzahl: 1)
Okay i've found a complete solution by myself using my knowledge however,the code is still not perfect.Can anybody tell me how to erase background of a window via his handle.
Btw i need this for a sidebar if anybody is interested why so much stuff.I want icons on my sidebar.
Delphi-Quellcode:
procedure TForm3.Button1Click(Sender: TObject);
var myhandle:hwnd; handle2:hwnd; handle3:hwnd; begin myhandle:=FindWindowEx(FindWindow('shell_traywnd', nil), 0, 'traynotifywnd', nil) ; if myhandle>0 then begin windows.SetParent(myhandle,0); MoveWindow(myhandle,0, -9,TaskBarwidth(myhandle), TaskBarheight(myhandle), true) end else showmessage('wont work handle is zero'); end; |
Re: Move taskbar
Somebody?I am sorry to bump but atleast give me a feedback.If am going the right way.. :cry:
|
Re: Move taskbar
#2 has all answers you're needing to deal with it.
In your code you're just moving the tray around, leaving all others at their place. |
Re: Move taskbar
i need to remove the taskbar so its transparent is it possible?
|
Re: Move taskbar
i dont get it, whats your problem exactly ?
do you want to remove the taskbar or just adjust the size of it ? for removing(making it invisible) use this:
Delphi-Quellcode:
for makin it transparent:
procedure ShowShellTrayWindow(Show: Boolean);
begin ShowWindow( FindWindow( 'shell_traywnd', 0 ), Integer(Show) ); end;
Delphi-Quellcode:
procedure TransparentTrayWindow(Percent: Byte);
var hWnd: Cardinal; begin hWnd := FindWindow( 'shell_traywnd', 0 ); if Percent in [1..100] then begin SetWindowLong( hWnd, GWL_EXSTYLE, GetWindowLong( hWnd, GWL_EXSTYLE ) or WS_EX_LAYERED ); SetLayeredWindowAttributes( hWnd, 0, Round($FF/$64*Percent), LWA_ALPHA ); end; end; |
Re: Move taskbar
What are we talkig about now? Moving the taskbar or erasing a window's background?
|
Re: Move taskbar
I erased the background so thats done.We are talking about moving. :oops:
I got it in X=1280 in Y=0 but cant move it anywhere else. I can't move it anywhere why is that?? :?
Delphi-Quellcode:
unit Unit3;
interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm3 = class(TForm) Button1: TButton; Edit1: TEdit; Label1: TLabel; Edit2: TEdit; Label2: TLabel; Label3: TLabel; Label4: TLabel; Timer1: TTimer; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Timer1Timer(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form3: TForm3; implementation {$R *.dfm} function TaskBarwidth(handle:hwnd): integer; var hTB: HWND; // taskbar handle TBRect: TRect; // taskbar rectangle begin hTB:= handle; if hTB = 0 then Result := 0 else begin GetWindowRect(hTB, TBRect); Result := TBRect.Left- TBRect.Right; end; end; function TaskBarHeight(handle:hwnd): integer; var hTB: HWND; // taskbar handle TBRect: TRect; // taskbar rectangle begin hTB:= handle; if hTB = 0 then Result := 0 else begin GetWindowRect(hTB, TBRect); Result := TBRect.Bottom - TBRect.Top; end; end; procedure TForm3.Button1Click(Sender: TObject); var myhandle:hwnd; handle2:hwnd; handle3:hwnd; begin myhandle:=FindWindow('shell_traywnd', nil); if myhandle>0 then MoveWindow(myhandle,strtoint(edit1.Text), strtoint(edit2.Text),TaskBarwidth(myhandle), TaskBarheight(myhandle), true) else showmessage('wont work handle is zero'); end; procedure TForm3.Button2Click(Sender: TObject); var myhandle:hwnd; begin myhandle:=FindWindowEx(FindWindow('shell_traywnd', nil), 0, 'traynotifywnd', nil) ; windows.SetParent(myhandle,0); end; procedure TForm3.Timer1Timer(Sender: TObject); var miska:tmouse; begin label3.Caption:=inttostr(miska.CursorPos.X); label4.Caption:=inttostr(miska.CursorPos.y); end; end. |
Re: Move taskbar
Sorry again,after i setparent(myhandle,0) i can't really move the window anymore why is that? :x :wall: :wall:
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:27 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz