Autor Beitrag
Maisinator
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167

Win XP HE SP3, Win Vista HP SP2
Delphi ;-)
BeitragVerfasst: Di 20.10.09 12:33 
hallo,

kann mir jemand sagen, warum application.minimize in dieser kompination
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
uses ShellAPI;
...
begin
ShellExecute(0, 'open', PChar('mein pfad'), Nil, Nil, SW_ShowNormal);
Application.Minimize;
end;

nicht funktioniert?
nach dem öffnen der datei passiert einfach nichts mehr. (die datei ist ca. 200MB groß)
trage ich jedoch keinen pfad ein, wird natürlich auch keine datei geöffnet, aber application.minimize funktioniert dann wieder :?:

THX

_________________
Das Unmögliche wagen, um das Mögliche möglich zu machen...
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Di 20.10.09 12:51 
probiers mal mit ShowWindowAsync // (ShowWindow)
Maisinator Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167

Win XP HE SP3, Win Vista HP SP2
Delphi ;-)
BeitragVerfasst: Di 20.10.09 12:56 
danke, werde ich machen. aber darf ich dich auch um eine kleine erklärung bitten? (was ist anders? usw.)?

_________________
Das Unmögliche wagen, um das Mögliche möglich zu machen...
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Di 20.10.09 13:17 
Was ist anders...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
ShowWindow ("Async") (aplication.handle, SW_MINIMIZE); // Windows API

Application.minimize;  // Unit Forms und ruft das auf

procedure TApplication.Minimize;
begin
  if not IsIconic(FHandle) then
  begin
    NormalizeTopMosts;
    SetActiveWindow(FHandle);
    if (MainForm <> nil) and (ShowMainForm or MainForm.Visible)
      and IsWindowEnabled(MainForm.Handle) then
    begin
      SetWindowPos(FHandle, MainForm.Handle, MainForm.Left, MainForm.Top,
        MainForm.Width, 0, SWP_SHOWWINDOW);
      DefWindowProc(FHandle, WM_SYSCOMMAND, SC_MINIMIZE, 0);
    end else
      ShowWinNoAnimate(FHandle, SW_MINIMIZE);
    if Assigned(FOnMinimize) then FOnMinimize(Self);
  end;
end;


Unterschied genug?

Edit:
ShowWindow wird hart gesagt tue mit (Handle, diese Aktion)
bei app.minimize; ruft man eben diese von Borlandianern ^^ zusammengeschreibselte procedure auf die noch einge dinge prüft usw...

Wenn du es noch genau wissen willst musst du es selbst nachforschen so genau hab ich mich jetzt nicht damit beschäftigt. ^^
Oder eine andere nette Person kann es dir aus dem Stehgreif erklären.


Zuletzt bearbeitet von thepaine91 am Di 20.10.09 13:24, insgesamt 1-mal bearbeitet
Maisinator Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167

Win XP HE SP3, Win Vista HP SP2
Delphi ;-)
BeitragVerfasst: Di 20.10.09 13:19 
danke, jetzt funktioniert es.

---Moderiert von user profile iconNarses: Beiträge zusammengefasst---

funktioniert dochnicht. fenster bleibt maximiert.

_________________
Das Unmögliche wagen, um das Mögliche möglich zu machen...
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Di 20.10.09 14:56 
:nixweiss: Dann weis ich jetzt auch nicht was du probieren könntest.
Maisinator Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167

Win XP HE SP3, Win Vista HP SP2
Delphi ;-)
BeitragVerfasst: Di 20.10.09 16:44 
Schade, dann muss ich das wohl oder übel weglassen...

_________________
Das Unmögliche wagen, um das Mögliche möglich zu machen...
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Di 20.10.09 17:09 
Höchstens du kannst mir sagen was du mit shellexecute aufrust dann kann ich es nachbilden. ;)
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 20.10.09 17:35 
Wenn du sagst, das ist ne 200MB Datei (wieso öffnet man sowas großes mit ShellExecute? :D): Vielleicht dauert das einfach nur extrem lange, und das Minimize wird erst nach einiger Zeit ausgeführt?

Was passiert denn, wenn du erst Minimize aufrufst, und danach erst ShellExecute (evtl. ein ProcessMessages dazwischen)?

_________________
PROGRAMMER: A device for converting coffee into software.
Maisinator Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 167

Win XP HE SP3, Win Vista HP SP2
Delphi ;-)
BeitragVerfasst: Di 20.10.09 17:46 
user profile iconXentar hat folgendes geschrieben Zum zitierten Posting springen:
Wenn du sagst, das ist ne 200MB Datei (wieso öffnet man sowas großes mit ShellExecute? :D):


womit soll ich das denn sonst öffnen?

user profile iconXentar hat folgendes geschrieben Zum zitierten Posting springen:
Vielleicht dauert das einfach nur extrem lange, und das Minimize wird erst nach einiger Zeit ausgeführt?


nope, nachdem das programm gestartet wurde passiert nichts mehr


Edit: wenn ich kleinere dateien mit shellexecute öffne, funktioniert application.minimize auch

_________________
Das Unmögliche wagen, um das Mögliche möglich zu machen...
thepaine91
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 763
Erhaltene Danke: 27

Win XP, Windows 7, (Linux)
D6, D2010, C#, PHP, Java(Android), HTML/Js
BeitragVerfasst: Do 22.10.09 08:10 
Dann hat Xentar vielleicht doch recht :nixweiss:
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Do 22.10.09 08:53 
vl. dann das shellexecute in nen Thread auslagern? :nixweiss:

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Andreas L.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1703
Erhaltene Danke: 25

Windows Vista / Windows 10
Delphi 2009 Pro (JVCL, DragDrop, rmKlever, ICS, EmbeddedWB, DEC, Indy)
BeitragVerfasst: Do 22.10.09 08:54 
user profile iconXentar hat folgendes geschrieben Zum zitierten Posting springen:
Wenn du sagst, das ist ne 200MB Datei (wieso öffnet man sowas großes mit ShellExecute? :D): Vielleicht dauert das einfach nur extrem lange, und das Minimize wird erst nach einiger Zeit ausgeführt?


Und so wirds auch sein. Application.Minimize wird erst ausgeführt wenn ShellExecute fertig ist, also die Datei vollständig gestartet wurde und das dauert bei 200 MB eben etwas.

ausblenden Delphi-Quelltext
1:
2:
if ShellExecute(...) > 32 then
  Application.Minimize;