Click here to Skip to main content
15,910,787 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Splash Screen Pin
Sangeetha_J19-Jan-07 15:58
Sangeetha_J19-Jan-07 15:58 
AnswerRe: Splash Screen Pin
Nibu babu thomas17-Jan-07 20:52
Nibu babu thomas17-Jan-07 20:52 
GeneralRe: Splash Screen Pin
Sangeetha_J17-Jan-07 23:48
Sangeetha_J17-Jan-07 23:48 
GeneralRe: Splash Screen Pin
Rajesh R Subramanian18-Jan-07 20:39
professionalRajesh R Subramanian18-Jan-07 20:39 
GeneralRe: Splash Screen Pin
Sangeetha_J18-Jan-07 21:19
Sangeetha_J18-Jan-07 21:19 
QuestionRe: Splash Screen Pin
Rajesh R Subramanian19-Jan-07 1:51
professionalRajesh R Subramanian19-Jan-07 1:51 
AnswerRe: Splash Screen Pin
Sangeetha_J19-Jan-07 15:56
Sangeetha_J19-Jan-07 15:56 
GeneralRe: Splash Screen Pin
Rajesh R Subramanian19-Jan-07 18:44
professionalRajesh R Subramanian19-Jan-07 18:44 
I am really really busy. But since we've come to this extent I will try and give you a solution. Now we will build a separate executable file, which would serve as a splash screen for your application (may be in the future some other app also can use it with modifications).

Let us prepare the splash screen Executable separately first.

1. Create a dialog based application (Don't add about box and unwantd stuff).

2. Add your animation (AVI or GIF or whatever) and play it successfully.

3. Now all you need is, this has to be full screen and preferably a black background.

4. Go to the InitInstance() function and use the SetDialogBkColor() function in it to make the dialog black:
SetDialogBkColor(RGB(0,0,0),RGB(100,150,150));<font color=green>//0,0,0 is black. you can change it.</font>

5. Go to the InitDialog() function and make it full screen. (Add the following code before the return statement in InitDialog(). This code will remove the caption and border of the dialog and make it full screen too!

<font color=green>//Thanks to Nishant Sivakumar for this code snippet</font>
int cx, cy;
HDC dc = ::GetDC(NULL);
cx = GetDeviceCaps(dc,HORZRES) +
    GetSystemMetrics(SM_CXBORDER);
cy = GetDeviceCaps(dc,VERTRES) +
    GetSystemMetrics(SM_CYBORDER);
::ReleaseDC(0,dc);

// Remove caption and border
SetWindowLong(m_hWnd, GWL_STYLE,
    GetWindowLong(m_hWnd, GWL_STYLE) &
(~(WS_CAPTION | WS_BORDER)));

// Put window on top and expand it to fill screen
::SetWindowPos(m_hWnd, HWND_TOPMOST,
    -(GetSystemMetrics(SM_CXBORDER)+1),
    -(GetSystemMetrics(SM_CYBORDER)+1),
    cx+1,cy+1, SWP_NOZORDER);

6. If you need to display a picture as a background for your splash screen dialog and not a color, read this[^] article. It is really simple to do. (BTW remove that SetDialogBkColor() stuff if you use this)

Now your splash screen is ready.

How to use it from another application?

1. Use ShellExecute() or CreateProcess() to show this splash executable.
2. Wait for a second or two using Sleep() command.
3. Then use PostMessage() from your application to close the splash screen.

You should be able to do it on your own. Need you require help, ask. Let me know if it helped.




Nobody can give you wiser advice than yourself. - Cicero
ப்ரம்மா

GeneralRe: Splash Screen Pin
Sangeetha_J20-Jan-07 0:34
Sangeetha_J20-Jan-07 0:34 
GeneralRe: Splash Screen Pin
Rajesh R Subramanian20-Jan-07 18:26
professionalRajesh R Subramanian20-Jan-07 18:26 
QuestionWinDbg help needed! Pin
A_L17-Jan-07 19:15
A_L17-Jan-07 19:15 
Questiondisplaying desktop window in another applications window Pin
tictactoer17-Jan-07 19:00
tictactoer17-Jan-07 19:00 
QuestionAbout Vc++ settings Pin
siddharthsan17-Jan-07 18:31
siddharthsan17-Jan-07 18:31 
AnswerRe: About Vc++ settings Pin
Hamid_RT17-Jan-07 18:45
Hamid_RT17-Jan-07 18:45 
GeneralRe: About Vc++ settings Pin
siddharthsan17-Jan-07 19:05
siddharthsan17-Jan-07 19:05 
AnswerRe: About Vc++ settings Pin
Stephen Hewitt17-Jan-07 18:55
Stephen Hewitt17-Jan-07 18:55 
GeneralRe: About Vc++ settings Pin
siddharthsan17-Jan-07 19:16
siddharthsan17-Jan-07 19:16 
QuestionProblem with combining CListCtrl and CTabCtrl Pin
tims8117-Jan-07 18:29
tims8117-Jan-07 18:29 
QuestionRe: Problem with combining CListCtrl and CTabCtrl Pin
David Crow18-Jan-07 3:31
David Crow18-Jan-07 3:31 
AnswerRe: Problem with combining CListCtrl and CTabCtrl Pin
tims8118-Jan-07 8:10
tims8118-Jan-07 8:10 
GeneralRe: Problem with combining CListCtrl and CTabCtrl Pin
David Crow18-Jan-07 8:15
David Crow18-Jan-07 8:15 
GeneralRe: Problem with combining CListCtrl and CTabCtrl Pin
tims8118-Jan-07 9:06
tims8118-Jan-07 9:06 
GeneralRe: Problem with combining CListCtrl and CTabCtrl Pin
David Crow18-Jan-07 9:09
David Crow18-Jan-07 9:09 
AnswerRe: Problem with combining CListCtrl and CTabCtrl Pin
malaugh18-Jan-07 7:24
malaugh18-Jan-07 7:24 
GeneralRe: Problem with combining CListCtrl and CTabCtrl Pin
tims8118-Jan-07 8:29
tims8118-Jan-07 8:29 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.