CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 22 of 22

Thread: Splash screen

  1. #16
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Splash screen

    I don't think there is any standard for a splash screen size. Personally, I do everything I can to avoid the need for one. If I'm doing so much initialization that the user might be concerned that the program hasn't started, then something is wrong with my design.

    If you must, I'd keep it as unobtrusive as possible. Perhaps no more than 320x240 (in case you're users are like my Mom and still run in 640x480). As for centering, that's just arithmetic; do you not know how to calculate that?

  2. #17
    Join Date
    Dec 2009
    Posts
    161

    Re: Splash screen

    First I'd need to know how to retrieve screen size. then I would I would divede width / 2 and height / 2. If my sreensplash window is 320x240 then I shoule place it (screen width / 2) - (window size / 2) the same goes for height...is that ok?

  3. #18
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Splash screen

    That's correct. You can get the desktop window rectangle for the screen size. You can call GetDesktopWindow() to get a HWND to the desktop window, and call GetWindowRect() on that handle, or just combine them:
    Code:
      RECT r;
    
      ::GetWindowRect(::GetDesktopWindow(),&r);

  4. #19
    Join Date
    Jul 2009
    Location
    India
    Posts
    835

    Re: Splash screen

    See.. If you want to show a splash screen then just use my attached file. though its written in mfc you would not have to put so much effort. Just use SplashClient.cpp file to show your bitmap as splash. And about center of screen:: this is also implemented in that piece of code so u dont need to worry about it. Finally, if you have a strong hold determination that you personally have to write a code for Splash screen in Win32API then I can't help you.

  5. #20
    Join Date
    Dec 2009
    Posts
    161

    Re: Splash screen

    Actually, I am forced to use regular win32 API instead of MFC.

  6. #21
    Join Date
    Feb 2005
    Posts
    2,160

    Re: Splash screen

    Forced by whom (or what)? Just say the word and we can send in the black helicopters.

  7. #22
    Join Date
    Dec 2009
    Posts
    161

    Re: Splash screen

    By the way, this works great as a splash screen:

    Code:
    //
    // Splash Screen
    //
    
    IDD_SPLASH DIALOG 0, 0, 300, 200
    STYLE DS_3DLOOK | DS_ABSALIGN | DS_CENTER | DS_FIXEDSYS | WS_VISIBLE | WS_POPUP
    FONT 8, "Ms Shell Dlg 2"
    BEGIN
        LTEXT "Splash Screen", IDC_STATIC, 127, 96, 46, 8, SS_LEFT
    END

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured