[C++] Image popup

Posted By: mpdeveloper_B

[C++] Image popup - 01/29/09 23:23

Meh...let's just say that I'm a complete noob at C++, and I would like to make a program that just pops up an image on the screen, waits a few seconds and then closes the program. More or less like the gamestudio launch screen starts up.

I know it's a relatively simple program, but I do not know my way around C++.
Posted By: bstudio

Re: [C++] Image popup - 01/30/09 08:13

Google is your friend:
http://code.logos.com/blog/2008/09/displaying_a_splash_screen_with_c_introduction.html
Posted By: mpdeveloper_B

Re: [C++] Image popup - 02/01/09 04:28

Thanks, I did search for it but my mind went blank and I didn't search specifically for "splash screen". I found a nice plugin for dev c++ which is what I use atm.

There is one more problem I'm having, I've been trying some stuff with keybd_event to try and make it close the spash screen when esc is pressed, but It keeps returning even though the button hasn't been pressed or released. Can you help?

this is the function for returning a value to signal if the button has been pressed and depressed (I used code from msdn and modified it)

Code:
int check_esc(BOOL bState)
{
    BYTE keyState[256];
    GetKeyboardState((LPBYTE)&keyState);
    if( (bState && !(keyState[VK_ESCAPE] & 1)) ||
          (!bState && (keyState[VK_ESCAPE] & 1)) )
    {
         keybd_event(VK_ESCAPE, 0x1B, 0, 0);
         keybd_event(VK_ESCAPE, 0x1B, KEYEVENTF_KEYUP, 0);
         return 76;
    }
}


and here's the code that tells it to return the value and exit:

Code:
if (check_esc(TRUE) == 76)
{ 
     //exit code here...
}


the problem is, It continues to return 76 even though the button hasn't been pressed or depressed....how do I fix this, or is there a better/shorter way to do this?
© 2024 lite-C Forums