Für manche total einfach doch für mich schwer



  • Hi ich bin grad neu eingestiegen in c++ und hab für nen kumpel nen programm erstellt was bissle aufmuntern soll er fand es ganz gut und hat mich gefragt ob ich des ausbauen kann

    Es handelt sich u nen Scherz klick programm das mann nur beenden kann wenn man immer auf ok klickt hier der quell text

    #define WIN32_LEAN_AND_MEAN
    #include <windows.h>
    int WINAPI WinMain(HINSTANCE hinstance, HINSTANCE hprevinstance,
    LPSTR lpcmdline, int ncmdshow)
    {
    MessageBox(0, "Viruz active", /*Inhalt Dlg.-Box*/
    "Viruz w32_bot type send message",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Festplatte wird Formatiert syntax type : format c:/", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Ganz schön scheiße sowas nä ?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Ich weiß am liebsten würdest du den Monitor aus dem Fenster werfen stimmt's ?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Nee?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Also ich würds tun", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Nein im ernst also ich würds tun", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Soll ich deine Festplatte löschen ?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Nee?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Doch !", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Ich nerv langsam nä ?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Ich bin dein Gewissen ehrlich", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Jezz sei nicht so sauer einmal triffts jeden", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Naja dann fangen wir mal an", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 0%", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 10%	oh jezz is der desktopwech", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 20% naja des waren wohl deine filme", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 30% sorry des waren die spiele", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 40% scheiße deine festplatte hat nur noch 60 %", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 50% naja nur noch die hälfte", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 60% reden wir erst gar nicht drüber", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 70%", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 80%", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 90% jezz wirds ernst", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "FORMAT C:/ = 99% 1% noch und deine festplatte is wech schade oder ?", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    MessageBox(0, "Naja wolln mal nicht so sein aba wehe du störst mich nochmal !", /*Inhalt Dlg.-Box*/
    "Formatierung",/*Titelleiste*/
    MB_OK | MB_ICONEXCLAMATION); /*OK-Button+!Bild*/
    
    return 0;
    }
    

    so wenn ihr euch des anschaut wißt ihr was ich meine aber ich will folgendes machen ich will aus dem programm nen art Nerv Tree machen also das es bestimmte laufbahn der nervaktion gibt hier ein bsp. aufbau

    Haupt Frage bsp: Darf ich dein PC haben ?
    

    bei dieser frage sollen 2 buttons entstehen einmal mit ja und einmal mit nein

    also so solls weiter gehen

    Hauptfrage
                                         |        |
                                      JA           NEIN
     jetzt die frage wenn man auf ja oder auf nein /sollen sich beide in verschiedene richtungen bewegen/ drückt
                                      |           |
                Dankedarf ich alles haben?         Warum nicht ?
    

    und immer so weiter ! wie geht sowas kann mir da jemand den quelltext dafür machen ?
    danke wäre sehr nett
    mfg:Blacky

    edit: Codetags hinzugefügt.



  • if / else



  • MessageBox() returned den Button der gedrückt wurde.

    Beispiel:

    int nRet;
    
    nRet = MessageBox("Darf ich?", "Frage", MB_YESNO);
    
    if (nRet == IDYES)
    {   
        // es wurde "ja" gedrückt
    }
    else if (nRet == IDNO)
    {
        // es wurde "nein" gedrückt
    }
    

    ist aber alles in der MSDN gut erklärt !



  • Dieser Thread wurde von Moderator/in HumeSikkins aus dem Forum C++ in das Forum WinAPI verschoben.

    Im Zweifelsfall bitte auch folgende Hinweise beachten:
    C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?

    Dieses Posting wurde automatisch erzeugt.



  • Black_Deagle schrieb:

    wie geht sowas kann mir da jemand den quelltext dafür machen ?

    PROGGER ALARM Sein Keyboard!

    Es bringt nichts wenn du kopierst und zusammen bastelst, lerne C++. Du bist tatsächlich in C++ "eingestiegen", durch Copy´n Paste. Beginne lieber mit C++, und lerne.
    Es wird auch keiner (hoffentlich) so dumm sein und dir den vollständigen Code posten.

    Ist nur gut gemeint, etwas programmiert zu haben macht dich selbst Stolz, aber etwas kopiert zu haben oder zusammen gebastelt, darfst du nie dein Eigen nennen.



  • MichaM. schrieb:

    PROGGER ALARM Sein Keyboard!

    *muuhahahaaa* 😃


Anmelden zum Antworten