Autor Beitrag
Kuyatzu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: So 16.09.07 12:44 
Hi
ich wollte ein launcher für ein paar games schreiben und hab dabei ein paar fragen hoffe ihr könnt sie mir beantworten
ich habe hir ein Beispiel mit CS 1.6 und wollte das in fenstermode spielen hab leider keine Ahnung wie ich das mache ohne das Fehler auftauchen.

So ich habe das Ganze nochmal verändern und ergänzt es klappt aber immer noch nicht.
(sollte ich es doch mal mit SetWindowPos versuchen? Wenn ja was brauche ich und was nicht?)

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
procedure TForm1.Button1Click(Sender: TObject);
begin
 ShellExecute(0, 'open','D:\Spiele\Counter Strike\Valve\hl.exe', nil, nil,  SW_SHOW);
 hWindow := FindWindow(nil,'Half-Life');
 ShowWindow(SW_SHOWMAXIMIZED,0);
 if hWindow <> 0 then
 MoveWindow(hWindow, 0, 0 , 800, 600, True)
 else
 ShowMessage('Progamm wurde nicht gefunden');

end


Zuletzt bearbeitet von Kuyatzu am So 16.09.07 17:26, 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: So 16.09.07 13:16 

_________________
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.
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: So 16.09.07 13:49 
In deinem Fall würde ich eher mal die Parameter anders übergeben. Ich glaube da gibt es einen für Fenster Modus :gruebel: .
Kuyatzu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: So 16.09.07 14:35 
wenn es einen Parameter für fenster modus gibt denn brauch ich den
wenn einer weiß wie der lautet denn sagt mir bitte wie
danke
Regan
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 2157
Erhaltene Danke: 72


Java (Eclipse), Python (Sublimetext 3)
BeitragVerfasst: So 16.09.07 15:01 
nach ein bisschen Suchen :www.thewall.de/conte...spielstart-parameter. Das sind aber welche für hl2.exe. Ich weiß nicht, in wie weit die für die 1.6er zutreffen. Aber such doch einfach mal bei google. Ich glaube da gab es mal eine wiki dazu.
Kuyatzu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: So 16.09.07 15:11 
eigentlich ist das nicht wonach ich suche wollte eigentlich sowas für ff7 machen da das sonne kleine
auflösung hat aber dafür gibt es sowas nicht
also muss ich das mit nem program über delphi machen aber das will nicht wie ich das will
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: So 16.09.07 15:14 
Hast Du schon mal was von Interpunktion und Großbuchstaben gehört? Deine Tastatur besitzt sowas nämlich und macht deinen Text sofort um einiges verständlicher :mahn:

_________________
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.
Kuyatzu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: So 16.09.07 16:10 
wow das hilft mir jetzt echt

gibt es denn wenigsten ein beispiel für die verwendung von

MoveWindow
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: So 16.09.07 16:14 
Ja.

MSDN: MoveWindow:
Example

For an example, see Creating, Enumerating, and Sizing Child Windows.


P.S.: Wenn im nächsten Post von Dir die Interpunktion fehlt, darfst Du selber die Lösung finden. Etwas eigenständige Arbeit wäre nicht ganz schlecht. ;-)

_________________
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.
Kuyatzu Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 26



BeitragVerfasst: So 16.09.07 16:42 
Na gut,
gibt es ein Weg ein Programm das schon an ist via Procedure wieder zu aktivieren(also in dem Vordergrund bringen).
Da ich das Programm minimiert habe.
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: So 16.09.07 16:57 
Für dein eigenes Programm kannst Du Application.BringToFront; nutzen.
Für ein Fremdes Programm musst Du das Fenster mit Hilfe von FindWindow suchen und dann mit ShowWindow und SW_RESTORE, SW_MAXIMIZE oder SW_SHOW wieder anzeigen.
Ferner kann es nötig sein, mit SetWindowPos den Z-Index des Fensters zu verändern, um dieses in den Vordergrund zu bringen.

_________________
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.