AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Delphi Zwei Windows Explorer starten und nebeneinander bildschirmfüllend positionieren
Thema durchsuchen
Ansicht
Themen-Optionen

Zwei Windows Explorer starten und nebeneinander bildschirmfüllend positionieren

Ein Thema von FarAndBeyond · begonnen am 23. Jun 2015 · letzter Beitrag vom 19. Jul 2016
 
hathor
(Gast)

n/a Beiträge
 
#18

AW: Zwei Windows Explorer starten und nebeneinander bildschirmfüllend positionieren

  Alt 15. Jul 2015, 07:21
Nach dem gleichen Verfahren lassen sich auch 2 IEXPLORE.exe anzeigen.
Es sind nur geringe Änderungen erforderlich.

Delphi-Quellcode:
unit Unit1; //20150630 20150715

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ExtCtrls, Winapi.ShellApi, Vcl.StdCtrls, Winapi.ShlObj, Winapi.ActiveX, System.Win.ComObj;

type
  TForm1 = class(TForm)
    Panel1: TPanel;
    Panel2: TPanel;
    Panel3: TPanel;
    bnClose: TButton;
    bnMax: TButton;
    bnMin: TButton;
    Button1: TButton;
    Button2: TButton;
    procedure FormShow(Sender: TObject);
    procedure FormResize(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure FormDestroy(Sender: TObject);
    procedure bnCloseClick(Sender: TObject);
    procedure bnMaxClick(Sender: TObject);
    procedure bnMinClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
    procedure ExplorerStart(aPanel: TPanel; aDirectory: string);
  protected

  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
  SetWindowLong(Handle, GWL_STYLE, (GetWindowLong(Handle, GWL_STYLE) and not WS_Caption));
end;

procedure TForm1.bnMaxClick(Sender: TObject);
begin Perform(WM_SYSCOMMAND,SC_MAXIMIZE,0); end;

procedure TForm1.bnMinClick(Sender: TObject);
begin Perform(WM_SYSCOMMAND,SC_MINIMIZE,0); end;

procedure TForm1.Button2Click(Sender: TObject);
begin //
end;

procedure TForm1.ExplorerStart(aPanel: TPanel; aDirectory: string);
var SEI: TShellExecuteInfo;
begin
  aPanel.Caption := aDirectory;
  FillChar(SEI, SizeOf(SEI), #0);
  SEI.cbSize := SizeOf(SEI);
  SEI.Wnd := Handle;
  SEI.fMask := SEE_MASK_NOCLOSEPROCESS;
  SEI.lpVerb := 'open';
  SEI.lpFile := PChar('iexplore.exe'); // <--------------------
  SEI.lpParameters := PChar(aDirectory);
  SEI.lpDirectory := nil;
  SEI.nShow := SW_MINIMIZE;
  if ShellExecuteEx(@SEI) then begin
    if SEI.hProcess > 32 then begin
      Sleep(500);
      aPanel.Tag := FindWindow('IEFrame',nil); // <--------------------
      if aPanel.Tag > 0 then begin
        Winapi.Windows.SetParent(aPanel.Tag, aPanel.Handle);
        SetWindowLongPtr(aPanel.Tag, GWL_STYLE, GetWindowLongPtr(aPanel.Tag, GWL_STYLE)
        and not WS_BORDER);
        SetWindowPos(aPanel.Tag, HWND_TOP, Left, Top, Width, Height, SWP_FRAMECHANGED);
      end;
    end;
  end;
  CloseHandle(SEI.hProcess);
end;
//------------------------------------------------------------------------------
procedure TForm1.FormDestroy(Sender: TObject);
begin
  if Panel1.Tag > 0 then PostMessage(Panel1.Tag, WM_CLOSE, 0, 0);
  if Panel2.Tag > 0 then PostMessage(Panel2.Tag, WM_CLOSE, 0, 0);
end;

procedure TForm1.bnCloseClick(Sender: TObject);
begin Application.Terminate; end;

procedure TForm1.FormResize(Sender: TObject);
begin
  Panel1.Width := ClientWidth div 2;
  if Panel1.Tag > 0 then MoveWindow(Panel1.Tag, 0, 0, Panel1.Width, Panel1.Height, True);
  if Panel2.Tag > 0 then MoveWindow(Panel2.Tag, 0, 0, Panel2.Width, Panel2.Height, True);
end;

procedure TForm1.FormShow(Sender: TObject);
begin
  ExplorerStart(Panel1,'-new www.web.de'); // <------------ // Sample
  ExplorerStart(Panel2,'-new www.google.de'); // <------------// Sample
end;

end.
Angehängte Grafiken
Dateityp: jpg IExplore2x.jpg (107,1 KB, 43x aufgerufen)
Dateityp: jpg WETTER-LTE-1.jpg (124,3 KB, 32x aufgerufen)

Geändert von hathor (15. Jul 2015 um 07:36 Uhr)
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 12:18 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz