ssapp.cpp
资源名称:ssbase.rar [点击查看]
上传用户:linpin
上传日期:2022-02-22
资源大小:24k
文件大小:2k
源码类别:
屏幕保护
开发平台:
Visual C++
- // ssapp.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ssbase.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CSSApp
- IMPLEMENT_DYNCREATE(CSSApp, CWinApp)
- CSSApp::CSSApp()
- {
- srand(time(NULL));
- }
- CSSApp::~CSSApp()
- {
- }
- BOOL CSSApp::MatchOption(LPTSTR lpsz, LPTSTR lpszOption)
- {
- if (lpsz[0] == _T('-') || lpsz[0] == _T('/'))
- lpsz++;
- if (lstrcmpi(lpsz, lpszOption) == 0)
- return TRUE;
- return FALSE;
- }
- BOOL CSSApp::InitInstance()
- {
- SetRegistryKey(_T("HG Screen Savers"));
- if (__argc == 1 || MatchOption(__argv[1], _T("c")))
- DoConfig();
- else
- if (MatchOption(__argv[1], _T("p")))
- {
- return DoSmall();
- }
- else
- if (MatchOption(__argv[1], _T("s")))
- {
- return DoFull();
- }
- return FALSE;
- }
- BOOL CSSApp::DoConfig(void)
- {
- return FALSE;
- }
- BOOL CSSApp::DoSmall(void)
- {
- CWnd* pParent = CWnd::FromHandle((HWND)atol(__argv[2]));
- ASSERT(pParent != NULL);
- CSmallWnd* pWnd = new CSmallWnd();
- if(pWnd->CreateAsShow(pParent))
- {
- m_pMainWnd = pWnd;
- return TRUE;
- }
- return FALSE;
- }
- BOOL CSSApp::DoFull(void)
- {
- CFullWnd* pWnd = new CFullWnd();
- if(pWnd->CreateAsTop())
- {
- m_pMainWnd = pWnd;
- return TRUE;
- }
- else
- return FALSE;
- }
- BEGIN_MESSAGE_MAP(CSSApp, CWinApp)
- //{{AFX_MSG_MAP(CSSApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CSSApp message handlers