Autor Beitrag
Stread
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Mo 05.01.09 21:25 
Wenn bei mir showmessage kommt wird als Fenstername immer der Programmname angezeigt. Wie kann man das ändern?
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 05.01.09 21:30 
Indem du z.B. Application.MessageBox verwendest. ;-)
Stread Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Mo 05.01.09 21:48 
Und wie genau. Ich hab alles ausprobiert und jetzt habe ich mein Programm geschrottet :(
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: Mo 05.01.09 21:52 
Mit einer MessageBox das Programm schrotten? Respekt..
Und WAS hast du "alles" ausprobiert? Code?

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

Win 7
Delphi XE
BeitragVerfasst: Mo 05.01.09 22:00 
Nee ich habe nur soviel ausprobiert und gelöscht dass mein Code zum teil weg war.

Das war in der Hife drin. Das erste kapiere ich nicht was jetzt für dei Abkürzungen Variablen etc sind und das zweite funktioniert nicht.
ausblenden Delphi-Quelltext
1:
function MessageBox(const Text: PChar; const Caption: PChar; Flags: Longint = MB_OK): Integer;					


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
begin
    NormalizeTopMosts;
    MessageBox('This should be on top.', 'Look', MB_OK);    // [smbOK]
    RestoreTopMosts;
  end;
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 05.01.09 22:01 
Application.MessageBox hatte ich geschrieben... :roll:
Das ist einfacher...

// EDIT:
Beispiel:
ausblenden Delphi-Quelltext
1:
2:
  Application.MessageBox('Ein kleines Beispiel', 'Der Fenstertitel',
    MB_OK or MB_ICONINFORMATION);
Stread Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Mo 05.01.09 22:31 
Ich habe das bei der Suche angegeben und das oben erwähnt kam raus. Warum heißt das or und nicht and? Man kann doch mehrere Sachen verbinden.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 05.01.09 22:57 
Das ist in diesem Fall ein binärer Operator, kein boolscher. ;-)
Denn die beiden Werte sind Integerkonstanten.
ausblenden Beispiel
1:
2:
  MB_YESNOCANCEL = $00000003;
  MB_ICONINFORMATION = $00000040;
ausblenden Binärdarstellung
1:
2:
MB_YESNOCANCEL = 00000010
MB_ICONINFORMATION = 01000000
Wenn du das mit or verknüpfst, dann sind die Bits beide gesetzt, das Ergebnis ist 01000010. Wenn du and benutzt, dann hieße das ja, dass nur Bits gesetzt werden, die in beiden Zahlen gesetzt sind. Und das sind ja keine, da die Bits für die einzelnen Optionen unterschiedlich sind. Das Ergebnis mit and wäre also immer 0. ;-)
Stread Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Mo 05.01.09 23:32 
OK danke.
Stread Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Sa 10.01.09 22:30 
Was neues was aber gut hierher passt: Wie kann ich einen String dazufügen? Bei
ausblenden Delphi-Quelltext
1:
2:
    Application.MessageBox(name + ' hat gewonnen!', 'Spielstand',
    MB_OK or MB_ICONINFORMATION);

Kommt der Fehler:
ausblenden Quelltext
1:
 E2010 Inkompatible Typen: 'TComponentName' und 'PWideChar'					
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Sa 10.01.09 22:32 
PChar() um name schreiben.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
DeddyH
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Sa 10.01.09 22:33 
ausblenden Delphi-Quelltext
1:
2:
Application.MessageBox(PChar(name + ' hat gewonnen!'), 'Spielstand',
    MB_OK or MB_ICONINFORMATION);
Stread Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 188

Win 7
Delphi XE
BeitragVerfasst: Sa 10.01.09 23:16 
Danke. :wave: