home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BUG 4
/
BUGCD1997_05.BIN
/
aplic
/
clip4win
/
clip4win.exe
/
C4W30E.HUF
/
SOURCE
/
SPLASH2.PRG
< prev
next >
Wrap
Text File
|
1995-11-22
|
2KB
|
87 lines
// Splash2.prg - splash (start-up) screen demo - non-OO version
//
// Written by: John M. Skelton, Nov-95.
//
// Copyright (C) 1995 Skelton Software, Kendal Cottage, Hillam, Leeds LS25 5HP, UK.
// All Rights Reserved.
//
// Part of Clip-4-Win.
#include "windows.ch"
#define NO_C4WCLASS
#include "commands.ch"
function main()
local oApp, oWnd
CREATE APPLICATION oApp WINDOW oWnd TITLE "Clip-4-Win Splash Screen Demo" ;
ON INIT DoInit(oWnd) ;
ON WM_PAINT OnPaint(oWnd)
return 0
static function DoInit(hWnd)
local hSplash, t1, aDlg
ShowWindow(hWnd, _GetnCmdShow())
// create a splash window for the user to see
#ifndef TIMER
CREATE DIALOG aDlg RESOURCE "SplashDlg"
SHOW DIALOG aDlg MODELESS IN hWnd RESULT hSplash
#else
// a modeless dialog
hSplash = CreateDialog( , "SplashDlg", hWnd, ;
{|hDlg, nMsg, nw, nl| TimerFunc(hDlg, nMsg, nw, nl)})
#endif
// do rest of init (here we just waste some time, as this is only a demo)
t1 = seconds() + 3
do while seconds() <= t1
enddo
#ifndef TIMER
// remove the splash window, if it's not self-removing (e.g. own timer)
if IsWindow(hSplash)
DestroyWindow(hSplash)
endif
#endif
return nil
static function OnPaint(oWnd)
cls
?
? " You can compile with:"
? " (default) Splash screen is removed after init done"
? " /dTIMER Splash screen with its own timer"
?
#ifndef TIMER
? "This EXE built without /dTIMER"
#else
? "This EXE built with /dTIMER"
#endif
return nil
#ifdef TIMER
static function TimerFunc(hDlg, nMsg, nw, nl)
do case
case nMsg == WM_INITDIALOG
// Here we limit how long the dialog is visible, using a timer.
SetTimer(hDlg, 1, 5000) // # milliseconds
return 1
case nMsg == WM_TIMER
KillTimer(hDlg, 1)
DestroyWindow(hDlg) // remove the dialog
return 1
endcase
return 0
#endif // TIMER