|
// DbView.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "DbMainWnd.h"
#include "DbViewRes.h"
HINSTANCE g_hInst = NULL;
CeDbMainWnd g_wnd;
#define CEAPP
#include <CeModule.h>
class CeDbViewApp: public CeAppModule
{
virtual int OnInitInstance(HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow);
virtual int OnExitInstance();
}
theApp;
///////////////////////////////////////////////////////////////////////////////
//
// OnInitInstance
//
///////////////////////////////////////////////////////////////////////////////
int CeDbViewApp::OnInitInstance(HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
LPCTSTR lpszTitle = _T("DbView");
INITCOMMONCONTROLSEX initCtrl;
initCtrl.dwSize = sizeof INITCOMMONCONTROLSEX;
initCtrl.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_COOL_CLASSES;
BOOL bRet = InitCommonControlsEx(&initCtrl);
//Check if we're running. If it's running then focus on the window
HWND hGenWnd = FindWindow(WC_CEGENERICWNDCLASS, lpszTitle);
if (hGenWnd)
{
SetForegroundWindow (hGenWnd);
return 1;
}
g_hInst = m_hInst;
BOOL bCreated = g_wnd.Create(
NULL,
NULL,
NULL,
lpszTitle,
WS_VISIBLE,
0,
NULL
);
if (! bCreated)
return 1;
HICON hSmallIcon = theApp.LoadSmallIcon(IDI_DB);
g_wnd.SetIcon(hSmallIcon, FALSE);
HICON hLargeIcon = theApp.LoadLargeIcon(IDI_DB);
g_wnd.SetIcon(hLargeIcon, TRUE);
g_wnd.ShowWindow(nCmdShow);
g_wnd.UpdateWindow();
return 0;
}
///////////////////////////////////////////////////////////////////////////////
//
// OnExitInstance
//
///////////////////////////////////////////////////////////////////////////////
int CeDbViewApp::OnExitInstance()
{
return 0;
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.