Frage zu Splashscreen



  • Hey @all,
    ich habe nach der Anleitung von http://www.c-plusplus.net/forum/viewtopic.php?t=12168&highlight=splash gearbeitet. Es wird auch für einen Bruchteil der Splash-Screen angezeigt, wie stelle ich es jedoch an, das der Splashschirm länger erscheint? Habe zwar am Formular einen Timer hinzugefügt, jedoch funktioniert es damit auch nicht.

    Vielen Dank im Voraus
    MfG Roman1311



  • while(GetTickCount() < ilCounts + 1000)
    

    an dieser stelle einfach die zahl hinter ilCounts erhöhen. also statt 1000 zB 2000 nehmen



  • Also, ich habe das mal hinzugefügt, jedoch bewirkt das nicht wirklich was
    Hier mal der Code:

    //---------------------------------------------------------------------------
    
    #include <vcl.h>
    #pragma hdrstop
    #include "Unit3.h"
    
    //---------------------------------------------------------------------------
    USEFORM("Unit1.cpp", frmMain);
    USEFORM("Unit2.cpp", frmAbout);
    USEFORM("Unit3.cpp", frmSplash);
    USEFORM("Unit4.cpp", frmPreference);
    //---------------------------------------------------------------------------
    WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
    {
            try
            {
                     Application->Initialize();
                     // Splash-Screen
                     if (AnsiString(GetCommandLine()).UpperCase().Pos("/NOSPLASH")==0) {
                       frmSplash = new TfrmSplash(static_cast<void *> (NULL));
                       int ilCounts = 5000;
    
                       // Splash-Screen zentrieren
                       frmSplash->Left = (Screen->Width-frmSplash->Width)/2;
                       frmSplash->Top = (Screen->Height-frmSplash->Height)/2;
    
                       // Splash-Screen anzeigen
                       while(GetTickCount() < ilCounts + 1000)
                         frmSplash->Show();
                       Application->ProcessMessages();
                     }
                     Application->Title = "Splashdemo";
                     Application->CreateForm(__classid(TfrmMain), &frmMain);
                     Application->CreateForm(__classid(TfrmAbout), &frmAbout);
                     Application->CreateForm(__classid(TfrmPreference), &frmPreference);
                     Application->Run();
            }
            catch (Exception &exception)
            {
                     Application->ShowException(&exception);
            }
            catch (...)
            {
                     try
                     {
                             throw Exception("");
                     }
                     catch (Exception &exception)
                     {
                             Application->ShowException(&exception);
                     }
            }
            return 0;
    }
    //---------------------------------------------------------------------------
    

    MfG smog_at



  • int ilCounts = 5000;
    ....
    while (GetTickCount() < ilCounts + 1000)
    

    Rechne mal: ilCounts + 1000, da ilCounts den Wert 5000 hat,
    plus 1000 ergiebt 6000.
    UND, welchen Wert liefert GetTickCount() ?

    Mach es doch so wie PuppetMaster2K sagte!

    int ilCounts = GetTickCount();
    ....
    while (GetTickCount() < ilCounts + 5000) // <<<<< HIER ändern !!!
    

    gruß Micha



  • Vielen Dank, hat sich schon erledigt, das mit dem GetTickCount() habe ich nun ins Hauptformular gegeben, dort wo auch auf "/NOSPLASH" geprüft wird.

    Vielen Dank für die schnellen Antworten
    MfG Roman1311


Anmelden zum Antworten