Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
PPTtimer.cpp
Package: PPTtimer.rar [view]
Upload User: chpname
Upload Date: 2018-11-08
Package Size: 69k
Code Size: 3k
Category:
Dialog_Window
Development Platform:
Visual C++
- // PPTtimer.cpp : Defines the class behaviors for the application.
- //
- #include "stdafx.h"
- #include "PPTtimer.h"
- #include "PPTtimerDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CPPTtimerApp
- BEGIN_MESSAGE_MAP(CPPTtimerApp, CWinApp)
- //{{AFX_MSG_MAP(CPPTtimerApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CPPTtimerApp construction
- CPPTtimerApp::CPPTtimerApp()
- {
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
- }
- /////////////////////////////////////////////////////////////////////////////
- // The one and only CPPTtimerApp object
- CPPTtimerApp theApp;
- HANDLE hmutex;//禁止程序重复运行的互斥量句柄
- /////////////////////////////////////////////////////////////////////////////
- // CPPTtimerApp initialization
- BOOL CPPTtimerApp::InitInstance()
- {
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
- AfxEnableControlContainer();
- //设置背景颜色
- SetDialogBkColor(RGB(255,255,128));//RGB(4,227,88));
- //禁制程序重复运行
- char appName[MAX_PATH];
- char appTitle[20]="", title[17]="";
- int i,j;
- ::GetModuleFileName(NULL,appName,MAX_PATH);
- ::GetFileTitle(appName,appTitle,20);
- for(i=0;i<=20;i++)
- {
- if((appTitle[i]=='.') && (appTitle[i+1]=='e') && (appTitle[i+2]=='x') && (appTitle[i+3]=='e'))
- {
- for(j=0;j<i;j++)
- {
- title[j]=appTitle[j];
- }
- break;
- }
- }
- hmutex=CreateMutex(NULL,TRUE,title);
- if(GetLastError()==ERROR_ALREADY_EXISTS)
- {
- MessageBox(NULL,"程序已经运行了","infor",MB_OK);
- return FALSE;
- }
- CPPTtimerDlg dlg;
- m_pMainWnd = &dlg;
- int nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
- }