Thread: Problems with splash screen

  1. #1
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485

    Problems with splash screen

    Hallo,

    I am trying to make a splash screen for my application, but the window that the splash screen should be in is transparent for some reason. Anyone experienced the same?

    The image I am loading is located at the correct place, as I am loading it later on with the exact same code, and it works then

    Here is code that I think is relevant:
    Code:
    HWND  splashScreen = CreateWindowEx( WS_EX_CLIENTEDGE,"STATIC","",
    	                                 WS_POPUP|WS_DLGFRAME|SS_BITMAP,xPos,yPos,xSize,ySize,
    									 hWnd,NULL,(HINSTANCE)GetWindowLong(hWnd, GWL_HINSTANCE),NULL);
    
    // Load the picture for the splash screen
    SendMessage( splashScreen, BM_SETIMAGE, IMAGE_BITMAP,
    	(LPARAM)LoadImage(NULL, TEXT("UI\\newFilmButton.bmp"), IMAGE_BITMAP,100,50,LR_LOADFROMFILE));
    
    // Show the splash screen
    ShowWindow(splashScreen,SW_SHOWNORMAL);
    UpdateWindow(splashScreen);
    Thanks,

  2. #2
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    Transparent as in you can't see it, or transparent as in it looks like a layered window?

    Also, splash screens are usually top most and have no parent or owner.

  3. #3
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    The most platform independant way to do this is to actually have a function that sets the transparency separately (which should also double check the OS version and whatnot). I would post code, but I don't feel like rewriting code that I am damn sure I have posted on the forums a few times before.

  4. #4
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    Thanks for the replies.

    This is my first win32 projects, so there are so many things I do not know how to do, and do not know how the api solves.

    I have fixed it now.

  5. #5
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    I'm just asking - you sure that this thing isn't always on top? As in it will hover above ALL windows?
    Because that's a design flaw - a quite common one, as well, and annoying.
    The splash window should be on top of your application's windows, but nothing else...

    Just checking here!
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  6. #6
    Unregistered User Yarin's Avatar
    Join Date
    Jul 2007
    Posts
    2,158
    >> The splash window should be on top of your application's windows, but nothing else...
    Hmm, I'm not so sure I agree. I like to know when somethings loading, and, when something big enough to have a splash screen is loading it would bog down the system to the point that you really wouldn't want to do anything else. It's like like it stays up that long.

  7. #7
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by Yarin View Post
    >> The splash window should be on top of your application's windows, but nothing else...
    Hmm, I'm not so sure I agree. I like to know when somethings loading...
    I agree. I like that too.

    Quote Originally Posted by Yarin View Post
    ...and, when something big enough to have a splash screen is loading it would bog down the system to the point that you really wouldn't want to do anything else...
    That's certainly not true. I can do a lot of things while stupid apps are loading. It's the essence of multi-tasking. To be able to do stuff while something else is doing stuff.

    And a big splash window staying on top on everything will block your view when you try to do something else. It's very annoying.
    Put the splash window into the taskbar as "My app - loading..." or something. Much, much better.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  8. #8
    Registered User
    Join Date
    Jul 2008
    Posts
    67
    Moin,

    maybe the link below will give you some examples for a Splash Screen ...

    http://www.codeguru.com/cpp/w-d/dislog/splashscreens/


    Greetz
    Greenhorn

  9. #9
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    Well, I dont really need a splash screen in the sense that it takes ages to load the application. It is more the people I am making the application for that wants to have a splash screen first.

    So basically I have:
    Make splash screen
    sleep for x second
    remove splash screen.

    >>I'm just asking - you sure that this thing isn't always on top? As in it will hover above ALL windows?
    The entire program runs in full screen (no task bar - no nothing), so it does not really matter I think.

    Thanks for the link Greenhorn__

  10. #10
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by h3ro View Post
    Well, I dont really need a splash screen in the sense that it takes ages to load the application. It is more the people I am making the application for that wants to have a splash screen first.
    Then perhaps it's a good idea to redo your application to start quicker? [Yes, that may be difficult, I know - but often the bottleneck of applications starting is either loading vast amounts of data that may not be needed, or loading vast amounts of data in an ineffecient way - or both]

    So basically I have:
    Make splash screen
    sleep for x second
    remove splash screen.
    Surely this should not use "sleep", but rather WaifForSingleObject (or WaitForMultipleObject), where the object is an indicator of "load finished".
    >>I'm just asking - you sure that this thing isn't always on top? As in it will hover above ALL windows?
    The entire program runs in full screen (no task bar - no nothing), so it does not really matter I think.

    Thanks for the link Greenhorn__
    Is that really necessary at startup? I'd let the app switch to full-screen once it has loaded up - that allows better ability to do other things during startup.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  11. #11
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    Yes but it also can be annoying, it's loading so you do otherthings... then all of a sudden it goes fullscreen.

  12. #12
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Better, do all the loading and display a splash and when finished, the flash screen blinks for attention in the taskbar.
    Click on it and click anywhere on the splash screen and it goes fullscreen since loading is done.
    Too many apps these days steal focus when they shouldn't. And by that I mean 99.99%.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  13. #13
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    Then perhaps it's a good idea to redo your application to start quicker? [Yes, that may be difficult, I know - but often the bottleneck of applications starting is either loading vast amounts of data that may not be needed, or loading vast amounts of data in an ineffecient way - or both]
    99% of the start up time goes into connecting to a webcam. Not sure I can speed that up?

    Is that really necessary at startup? I'd let the app switch to full-screen once it has loaded up - that allows better ability to do other things during startup.
    Its an aplication for kids, so we wanted the application to be "kid prof". There is no easy way to exit the program, and while you are in the program you cant do anything else then using it.

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Well, I guess that makes it pretty special case, so it may be fine as it is then.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. openGL space shooter problems
    By c_young in forum Game Programming
    Replies: 0
    Last Post: 01-17-2007, 04:33 PM
  2. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  3. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM
  4. Splash Screen in C++(2)
    By cfrost in forum C++ Programming
    Replies: 1
    Last Post: 04-26-2004, 06:37 AM
  5. Splash Screen
    By RaviRaj in forum Windows Programming
    Replies: 0
    Last Post: 08-23-2002, 09:51 PM