Autor Beitrag
crncpz
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 59

WIN 2000, WIN XP Pro
Delphi 6
BeitragVerfasst: Fr 09.05.08 10:39 
Hallo

ich versuche gerade den tray Bereich in mein programm zu verschieben, das klappt auch mit der folgenden anweisung

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
begin
  h := FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'TrayNotifyWnd', nil);
  Windows.SetParent(h, form1.Handle);
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  h := FindWindowEx(form1.Handle, 0, 'TrayNotifyWnd', nil);
  Windows.SetParent(h, FindWindow('Shell_TrayWnd', nil));
end;


Mein Problem ist jetzt allerdings, das die leftposition beibehalten wird, die es in der Taskleiste hatte. Also ganz weit rechts.
Ich habe schon rum probiert, bekomme es aber nicht hin das ich left:=0 für das Shell_TrayWnd setzen kann.

vielen Dank für eure Hilfe


Zuletzt bearbeitet von crncpz am Mi 14.05.08 16:19, insgesamt 1-mal bearbeitet
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 12.05.08 16:46 
SetWindowPos ;-)

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
crncpz Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 59

WIN 2000, WIN XP Pro
Delphi 6
BeitragVerfasst: Mi 14.05.08 16:18 
danke das klingt so als ob es funktionieren würde.

wenn ich das auf form1 anwende klappt das auch super und das fenster wird verschoben.
ausblenden Delphi-Quelltext
1:
setwindowpos(form1.handle,HWND_TOPMOST,0,0,200,50,SWP_NOACTIVATE);					


wenn ich aber versuche das auf den TrayNotifyWnd Bereich an zu wenden macht es überhaupt nichts?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
h := FindWindowEx(FindWindow('Shell_TrayWnd', nil), 0, 'TrayNotifyWnd', nil);
windows.SetParent(h,form1.Handle);
h := FindWindowEx(form1.Handle, 0, 'TrayNotifyWnd', nil);
setwindowpos(h,HWND_TOPMOST,0,0,200,50,SWP_NOACTIVATE);


hat jemand eine idee woran das liegen kann das sich TrayNotifyWnd nicht verschieben lässt?
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mi 14.05.08 21:00 
Der zweite FindWindow-Befehl ist überflüssig, da H zu dem Zeitpunkt schon das richtige Handle ist.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
crncpz Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 59

WIN 2000, WIN XP Pro
Delphi 6
BeitragVerfasst: Fr 16.05.08 12:52 
ok das könnte man weglassen, aber die position wird leider noch immer nicht geändert.