|
// DbView.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
#include "MainWnd.h"
#include "ftpViewRes.h"
#define CEAPP
#include <CeModule.h>
HINSTANCE g_hInst = NULL;
CeMainWnd g_wnd;
class CeFtpViewApp: public CeAppModule
{
virtual int OnInitInstance(HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow);
virtual int OnExitInstance();
}
theApp;
int CeFtpViewApp::OnInitInstance(HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
LPCTSTR lpszTitle = _T("ftpView");
INITCOMMONCONTROLSEX initCtrl;
initCtrl.dwSize = sizeof INITCOMMONCONTROLSEX;
initCtrl.dwICC = ICC_WIN95_CLASSES | ICC_DATE_CLASSES | ICC_COOL_CLASSES;
BOOL bRet = InitCommonControlsEx(&initCtrl);
WORD wVersionRequested = MAKEWORD( 1, 0 );
WSADATA wsaData;
int nErr = WSAStartup( wVersionRequested, &wsaData );
if ( nErr != 0 )
{
// Tell the user that we could not find a usable WinSock DLL.
return 1;
}
//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_APPICON);
g_wnd.SetIcon(hSmallIcon, FALSE);
HICON hLargeIcon = theApp.LoadLargeIcon(IDI_APPICON);
g_wnd.SetIcon(hLargeIcon, TRUE);
g_wnd.ShowWindow(nCmdShow);
g_wnd.UpdateWindow();
return 0;
}
int CeFtpViewApp::OnExitInstance()
{
WSACleanup();
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.