Herzlich Willkommen, lieber Gast!
  Sie befinden sich hier:

  Forum » C / C++ (WinAPI, Konsole) » msgbox cancel oder ok button usen

Forum | Hilfe | Team | Links | Impressum | > Suche < | Mitglieder | Registrieren | Einloggen
  Quicklinks: MSDN-Online || STL || clib Reference Grundlagen || Literatur || E-Books || Zubehör || > F.A.Q. < || Downloads   

Autor Thread - Seiten: > 1 <
000
10.12.2004, 19:38 Uhr
~al3x
Gast


sry, dass ich schon wieder frage, aber bei msdn war mir das zu kompliziert!
wie kann ich den ok button mit einem command belegen und beim abbrechen button das programm dann beenden?
msgboxbsp.:
C++:
MessageBox(0,"bitte ok drücken um das readme zu öffnen","help",MB_ICONINFORMATION | MB_OKCANCEL)

Dieser Post wurde am 11.12.2004 um 10:47 Uhr von FloSoft editiert.
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
001
10.12.2004, 19:41 Uhr
~aL3x
Gast


hilfe, was ist da passiert?
hier nochmal wies aussehen soll:
sorry,dass ich schon wieder frage, aber bei msdn war mir das zu kompliziert!
wie kann ich den ok button mit einem command belegen und beim abbrechen button das programm dann beenden?
msgboxbsp.:

C++:
MessageBox(0,"bitte ok drücken um das readme zu öffnen","help",MB_ICONINFORMATION | MB_OKCANCEL) ;

 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
002
10.12.2004, 22:20 Uhr
RedEagle




C++:
int msg = MessageBox(/*...*/);

if(msg == /*ich gleube 1*/)
{
//Befehl ausführen
}
else
{
return 0;
}


--
MFG RedEagle
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
003
10.12.2004, 23:00 Uhr
~aL3x
Gast


da haste richtig geglaubt!! die 1 steht für den ok button!
thx 4 help
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
004
11.12.2004, 08:52 Uhr
Tommix



'Morgen,

Zitat von ~aL3x:
da haste richtig geglaubt!! die 1 steht für den ok button!
thx 4 help

Sowas braucht man nicht zu wissen, geschweige denn zu glauben:

C++:
if (IDOK == msg)
{
  ...
}


Zitat von MSDN:

Return Value

Zero if there is not enough memory to display the message box; otherwise one of the following values is returned:

IDABORT The Abort button was selected.


IDCANCEL The Cancel button was selected.


IDIGNORE The Ignore button was selected.


IDNO The No button was selected.


IDOK The OK button was selected.


IDRETRY The Retry button was selected.


IDYES The Yes button was selected.
If a message box has a Cancel button, the IDCANCEL value will be returned if either the ESC key is pressed or the Cancel button is selected. If the message box has no Cancel button, pressing the ESC key has no effect.



- Tommix

Dieser Post wurde am 11.12.2004 um 08:52 Uhr von Tommix editiert.
 
Profil || Private Message || Suche Download || Zitatantwort || Editieren || Löschen || IP
Seiten: > 1 <     [ C / C++ (WinAPI, Konsole) ]  


ThWBoard 2.73 FloSoft-Edition
© by Paul Baecher & Felix Gonschorek (www.thwboard.de)

Anpassungen des Forums
© by Flo-Soft (www.flo-soft.de)

Sie sind Besucher: