Category : C++ Source Code
Archive   : EXECWA.ZIP
Filename : TESTWAIT.CPP
Output of file : TESTWAIT.CPP contained in archive : EXECWA.ZIP
TestWait.CPP ----- Shell Program To Test ExecWait
*/
#include "TestWait.h"
//============================================================================
// WinMain
// Entry point for this applicaton
//============================================================================
int PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine,
int nCmdShow)
{
TestWaitApp TestWait("", hInstance, hPrevInstance, lpCmdLine, nCmdShow);
TestWait.Run();
return TestWait.Status;
}
/****************************************************************************
Application Class Members
*****************************************************************************/
//============================================================================
// InitMainWindow
// Constructs main window of demo
//============================================================================
void TestWaitApp::InitMainWindow(void)
{
MainWindow = new TestWait((LPSTR)MAKEINTRESOURCE(MAINMENU_DLG));
}
/****************************************************************************
Window Class members
*****************************************************************************/
//============================================================================
// Contstructor for the window
//============================================================================
TestWait::TestWait(LPSTR ATitle): TDialog(NULL, ATitle)
{
BWCCGetVersion(); //Make Sure Borland Custom Controls get loaded
pbExecWait = new TButton(this, IDD_EXECWAIT); //Associate Control
}
//============================================================================
// ExitMenu
//============================================================================
void TestWait::ExitMenu(RTMessage Msg)
{
if (pExecWait) //In case exit is pressed before end of application
delete pExecWait;
TDialog::Ok(Msg);
}
//============================================================================
// TestExecWait
//============================================================================
#pragma argsused
void TestWait::TestExecWait(RTMessage Msg)
{
pExecWait = new ExecWait(HWindow,GetApplication()->hInstance, "TestApp.pif");
if (pExecWait->Error())
{
SetDlgItemText(HWindow, IDD_STATUS, "Error Starting Application");
delete pExecWait;
pExecWait = NULL;
}
else
{
SetDlgItemText(HWindow, IDD_STATUS, "Application Started");
EnableWindow(pbExecWait->HWindow, FALSE); //Disable only 1 spawn @ a time
}
}
//============================================================================
// GetWindowClass
// Sets up window specific information for this class
//============================================================================
void TestWait::GetWindowClass(WNDCLASS& wc)
{
TDialog::GetWindowClass(wc);
wc.lpfnWndProc = BWCCDefDlgProc;
wc.hIcon = LoadIcon(wc.hInstance, MAKEINTRESOURCE(MAINMENU_ICON));
}
//============================================================================
// ProcessExecWait
//============================================================================
void TestWait::ProcessExecWait(RTMessage Msg)
{
int nRetVal = Msg.WParam;
if (pExecWait)
{
delete pExecWait;
pExecWait = NULL;
}
SetDlgItemText(HWindow, IDD_STATUS, "Application Terminated");
EnableWindow(pbExecWait->HWindow, TRUE);
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/