亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? main.cpp

?? dc++(一個(gè)曾經(jīng)大量使用的p2p)的源代碼,dc++,開(kāi)源的p2p源代碼
?? CPP
字號(hào):
/* 
 * Copyright (C) 2001-2003 Jacek Sieka, j_s@telia.com
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#include "stdafx.h"
#include "../client/DCPlusPlus.h"
#include "Resource.h"

#include "MainFrm.h"
#include "ExtendedTrace.h"
#include "WinUtil.h"
#include "SingleInstance.h"

#include <delayimp.h>
CAppModule _Module;

CriticalSection cs;
enum { DEBUG_BUFSIZE = 2048 };
char buf[DEBUG_BUFSIZE];

#ifndef _DEBUG

FARPROC WINAPI FailHook(unsigned /* dliNotify */, PDelayLoadInfo  /* pdli */) {
	MessageBox(NULL, "DC++ just encountered an unhandled exception and will terminate. Please do not report this as a bug, as DC++ was unable to collect the information needed for a useful bug report (Your Operating System doesn't support the functionality needed, probably because it's too old).", "Unhandled Exception", MB_OK | MB_ICONERROR);
	exit(-1);
}

#endif

LONG __stdcall DCUnhandledExceptionFilter( LPEXCEPTION_POINTERS e )
{
	Lock l(cs);

#ifndef _DEBUG
#if _MSC_VER == 1200
	__pfnDliFailureHook = FailHook;
#elif _MSC_VER == 1300
	__pfnDliFailureHook2 = FailHook;
#else
#error Unknown Compiler version
#endif

	// The release version loads the dll and pdb:s here...
	EXTENDEDTRACEINITIALIZE( Util::getAppPath().c_str() );

#endif

	File f(Util::getAppPath() + "exceptioninfo.txt", File::WRITE, File::OPEN | File::CREATE);
	f.setEndPos(0);
	
	DWORD exceptionCode = e->ExceptionRecord->ExceptionCode ;

	sprintf(buf, "\r\nUnhandled Exception\r\n  Code: %x\r\nVersion: %s\r\nOs: %s\r\n", 
		exceptionCode, VERSIONSTRING, Util::getOsVersion().c_str() );

	f.write(buf);

	STACKTRACE2(f, e->ContextRecord->Eip, e->ContextRecord->Esp, e->ContextRecord->Ebp);
	f.close();

#ifndef _DEBUG
	EXTENDEDTRACEUNINITIALIZE();
	
	MessageBox(NULL, "DC++ just encountered an unhandled exception and will terminate. If you plan on reporting this bug to the bug report forum, make sure you have downloaded the debug information (DCPlusPlus.pdb) for your version of DC++. A file named \"exceptioninfo.txt\" has been generated in the same directory as DC++. Please include this file in the report or it'll be removed / ignored. If the file contains a lot of lines that end with '?', it means that the debug information is not correctly installed or your Windows doesn't support the functionality needed, and therefore, again, your report will be ignored/removed.", "Unhandled Exception", MB_OK | MB_ICONERROR);
	exit(-1);
#else
	return EXCEPTION_CONTINUE_SEARCH;
#endif
}

static void sendCmdLine(HWND hOther, LPTSTR lpstrCmdLine)
{
	string cmdLine = _T(lpstrCmdLine);
	LRESULT result;

	COPYDATASTRUCT cpd;
	cpd.dwData = 0;
	cpd.cbData = cmdLine.length() + 1;
	cpd.lpData = (void *)cmdLine.c_str();
	result = SendMessage(hOther, WM_COPYDATA, NULL,	(LPARAM)&cpd);
}

BOOL CALLBACK searchOtherInstance(HWND hWnd, LPARAM lParam) {
	DWORD result;
	LRESULT ok = ::SendMessageTimeout(hWnd, WMU_WHERE_ARE_YOU, 0, 0,
		SMTO_BLOCK | SMTO_ABORTIFHUNG, 5000, &result);
	if(ok == 0)
		return TRUE;
	if(result == WMU_WHERE_ARE_YOU) {
		// found it
		HWND *target = (HWND *)lParam;
		*target = hWnd;
		return FALSE;
	}
	return TRUE;
}

static void installUrlHandler() {
	HKEY hk; 
	char Buf[512];
	string app = "\"" + Util::getAppName() + "\" %1";
	Buf[0] = 0;

	if(::RegOpenKeyEx(HKEY_CLASSES_ROOT, "dchub\\Shell\\Open\\Command", 0, KEY_WRITE | KEY_READ, &hk) == ERROR_SUCCESS) {
		DWORD bufLen = sizeof(Buf);
		DWORD type;
		::RegQueryValueEx(hk, NULL, 0, &type, (LPBYTE)Buf, &bufLen);
		::RegCloseKey(hk);
	}

	if(Util::stricmp(app.c_str(), Buf) != 0) {
		::RegCreateKey(HKEY_CLASSES_ROOT, "dchub", &hk);
		char* tmp = "URL:Direct Connect Protocol";
		::RegSetValueEx(hk, NULL, 0, REG_SZ, (LPBYTE)tmp, strlen(tmp) + 1);
		::RegSetValueEx(hk, "URL Protocol", 0, REG_SZ, (LPBYTE)"", 1);
		::RegCloseKey(hk);

		::RegCreateKey(HKEY_CLASSES_ROOT, "dchub\\Shell\\Open\\Command", &hk);
		::RegSetValueEx(hk, "", 0, REG_SZ, (LPBYTE)app.c_str(), app.length() + 1);
		::RegCloseKey(hk); 

		::RegCreateKey(HKEY_CLASSES_ROOT, "dchub\\DefaultIcon", &hk);
		app = Util::getAppName();
		::RegSetValueEx(hk, "", 0, REG_SZ, (LPBYTE)app.c_str(), app.length() + 1);
		::RegCloseKey(hk);
	}
} 

static void checkCommonControls() {
#define PACKVERSION(major,minor) MAKELONG(minor,major)

	HINSTANCE hinstDll;
	DWORD dwVersion = 0;
	
	hinstDll = LoadLibrary("comctl32.dll");
	
	if(hinstDll)
	{
		DLLGETVERSIONPROC pDllGetVersion;
	
		pDllGetVersion = (DLLGETVERSIONPROC) GetProcAddress(hinstDll, "DllGetVersion");
		
		if(pDllGetVersion)
		{
			DLLVERSIONINFO dvi;
			HRESULT hr;
			
			ZeroMemory(&dvi, sizeof(dvi));
			dvi.cbSize = sizeof(dvi);
			
			hr = (*pDllGetVersion)(&dvi);
			
			if(SUCCEEDED(hr))
			{
				dwVersion = PACKVERSION(dvi.dwMajorVersion, dvi.dwMinorVersion);
			}
		}
		
		FreeLibrary(hinstDll);
	}

	if(dwVersion < PACKVERSION(5,80)) {
		MessageBox(NULL, "Your version of windows common controls is too old for DC++ to run correctly, and you will most probably experience problems with the user interface. You should download version 5.80 or higher from the DC++ homepage or from Microsoft directly.", "User Interface Warning", MB_OK);
	}
}

void callBack(void* x, const string& a) {
	::SetWindowText((HWND)x, (STRING(LOADING) + "(" + a + ")").c_str());
	::RedrawWindow((HWND)x, NULL, NULL, RDW_UPDATENOW);
}

static int Run(LPTSTR /*lpstrCmdLine*/ = NULL, int nCmdShow = SW_SHOWDEFAULT)
{
	checkCommonControls();

	CMessageLoop theLoop;
	_Module.AddMessageLoop(&theLoop);
	
	MainFrame wndMain;

	CEdit dummy;
	CEdit splash;
	
	CRect rc;
	rc.bottom = GetSystemMetrics(SM_CYFULLSCREEN);
	rc.top = (rc.bottom / 2) - 20;

	rc.right = GetSystemMetrics(SM_CXFULLSCREEN);
	rc.left = rc.right / 2 - 150;
	rc.right = rc.left + 300;

	dummy.Create(NULL, rc, APPNAME " " VERSIONSTRING, WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | 
		ES_CENTER | ES_READONLY, WS_EX_STATICEDGE);
	splash.Create(NULL, rc, APPNAME " " VERSIONSTRING, WS_POPUP | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | 
		ES_CENTER | ES_READONLY, WS_EX_STATICEDGE);
	splash.SetFont((HFONT)GetStockObject(DEFAULT_GUI_FONT));
	
	rc.bottom = rc.top + WinUtil::getTextHeight(splash.m_hWnd, splash.GetFont()) + 4;
	splash.HideCaret();
	splash.SetWindowPos(HWND_TOPMOST, &rc, SWP_SHOWWINDOW);
	splash.SetFocus();
	splash.RedrawWindow();

	startup(callBack, (void*)splash.m_hWnd);

	splash.DestroyWindow();
	dummy.DestroyWindow();

	SettingsManager::getInstance()->setDefault(SettingsManager::BACKGROUND_COLOR, (int)(GetSysColor(COLOR_WINDOW)));
	SettingsManager::getInstance()->setDefault(SettingsManager::TEXT_COLOR, (int)(GetSysColor(COLOR_WINDOWTEXT)));
	
	if(BOOLSETTING(URL_HANDLER)) {
		installUrlHandler();
	}

	rc = wndMain.rcDefault;

	if( (SETTING(MAIN_WINDOW_POS_X) != CW_USEDEFAULT) &&
		(SETTING(MAIN_WINDOW_POS_Y) != CW_USEDEFAULT) &&
		(SETTING(MAIN_WINDOW_SIZE_X) != CW_USEDEFAULT) &&
		(SETTING(MAIN_WINDOW_SIZE_Y) != CW_USEDEFAULT) ) {

		rc.left = SETTING(MAIN_WINDOW_POS_X);
		rc.top = SETTING(MAIN_WINDOW_POS_Y);
		rc.right = rc.left + SETTING(MAIN_WINDOW_SIZE_X);
		rc.bottom = rc.top + SETTING(MAIN_WINDOW_SIZE_Y);
		// Now, let's ensure we have sane values here...
		if( (rc.left < 0 ) || (rc.top < 0) || (rc.right - rc.left < 10) || ((rc.bottom - rc.top) < 10) ) {
			rc = wndMain.rcDefault;
		}
	}

	if(wndMain.CreateEx(NULL, rc) == NULL) {
		ATLTRACE(_T("Main window creation failed!\n"));
		return 0;
	}
	
	wndMain.ShowWindow((nCmdShow == SW_SHOWDEFAULT) ? SETTING(MAIN_WINDOW_STATE) : nCmdShow);
	
	int nRet = theLoop.Run();
	
	_Module.RemoveMessageLoop();
	return nRet;
}

int WINAPI _tWinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPTSTR lpstrCmdLine, int nCmdShow)
{

	dcdebug("String: %d\n", sizeof(string));
#ifndef _DEBUG
	SingleInstance dcapp("{DCPLUSPLUS-AEE8350A-B49A-4753-AB4B-E55479A48351}");

	if(dcapp.IsAnotherInstanceRunning()) {
		HWND hOther = NULL;
		EnumWindows(searchOtherInstance, (LPARAM)&hOther);

		if( hOther != NULL ) {
			// pop up
			::SetForegroundWindow(hOther);

			if( IsIconic(hOther)) {
				// restore
				::ShowWindow(hOther, SW_RESTORE);
			}
			sendCmdLine(hOther, lpstrCmdLine);
		}

		return FALSE;
	}
#endif
	
	HRESULT hRes = ::CoInitialize(NULL);
#ifdef _DEBUG
	EXTENDEDTRACEINITIALIZE( Util::getAppPath().c_str() );
	//File::deleteFile(Util::getAppPath() + "exceptioninfo.txt");
#endif
	SetUnhandledExceptionFilter(&DCUnhandledExceptionFilter);
	
	WSADATA wsaData;
	WSAStartup(MAKEWORD(2, 2), &wsaData);
	
	// this resolves ATL window thunking problem when Microsoft Layer for Unicode (MSLU) is used
	::DefWindowProc(NULL, 0, 0, 0L);
	
	AtlInitCommonControls(ICC_COOL_CLASSES | ICC_BAR_CLASSES | ICC_LISTVIEW_CLASSES | ICC_TREEVIEW_CLASSES |
		ICC_UPDOWN_CLASS);	// add flags to support other controls
	
	hRes = _Module.Init(NULL, hInstance);
	ATLASSERT(SUCCEEDED(hRes));
	
	int nRet = Run(lpstrCmdLine, nCmdShow);
	
	_Module.Term();
	::CoUninitialize();
#ifdef _DEBUG
	EXTENDEDTRACEUNINITIALIZE();
#endif
	return nRet;
}

/**
 * @file
 * $Id: main.cpp,v 1.13 2003/07/15 14:53:12 arnetheduck Exp $
 */

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人免费视频免费观看| 99精品视频在线免费观看| 国产精品污www在线观看| 在线观看日韩电影| 国产伦理精品不卡| 亚洲精品午夜久久久| 久久久精品黄色| 日韩欧美自拍偷拍| 欧美三级中文字幕| 91丨九色porny丨蝌蚪| 激情欧美一区二区| 日本道精品一区二区三区| 久久国产夜色精品鲁鲁99| 夜夜精品视频一区二区 | 日本高清视频一区二区| 激情久久五月天| 日韩国产欧美在线播放| 一区二区三区蜜桃网| 国产精品私人自拍| 精品99一区二区三区| 91精品国产91久久久久久一区二区| av午夜精品一区二区三区| 国产精品亚洲а∨天堂免在线| 免费在线成人网| 五月天欧美精品| 亚洲福利一区二区| 亚洲第一福利视频在线| 亚洲国产欧美日韩另类综合| 亚洲黄色av一区| 亚洲图片你懂的| 亚洲少妇30p| 亚洲婷婷在线视频| 亚洲人成小说网站色在线| 中文字幕在线观看一区二区| 欧美极品少妇xxxxⅹ高跟鞋| 久久久久久久电影| 久久久综合精品| 欧美国产成人精品| 日本一区二区三区国色天香| 久久久99精品免费观看不卡| xf在线a精品一区二区视频网站| 欧美xfplay| 精品免费日韩av| 久久亚区不卡日本| 久久新电视剧免费观看| 激情综合色综合久久| 极品少妇一区二区三区精品视频| 久久精品国产秦先生| 美女任你摸久久| 久久黄色级2电影| 国产成人av福利| 成人一区二区三区| 91在线一区二区| 91成人网在线| 欧美精品aⅴ在线视频| 日韩一区二区在线免费观看| 日韩免费看的电影| 久久精品人人做| 中文字幕一区在线观看| 亚洲黄一区二区三区| 一区二区免费看| 麻豆精品在线播放| 国产成人综合在线观看| 99久久精品免费| 欧美探花视频资源| 精品理论电影在线| 国产人久久人人人人爽| 亚洲品质自拍视频| 午夜精品久久久久影视| 久热成人在线视频| 99久久精品国产精品久久| 欧美揉bbbbb揉bbbbb| 亚洲精品一区二区三区99| 日本一区二区不卡视频| 一区二区三区久久| 美女视频一区在线观看| 国产999精品久久久久久绿帽| 色噜噜狠狠成人网p站| 欧美一级淫片007| 国产精品久久久久久久久快鸭| 亚洲一区二区五区| 国产美女视频一区| 欧美日韩一区视频| 国产视频亚洲色图| 午夜精品福利一区二区三区av| 国产综合色产在线精品| 91极品视觉盛宴| 国产性天天综合网| 亚洲成人av福利| 成人一区二区三区| 日韩欧美国产午夜精品| 最新成人av在线| 老司机免费视频一区二区| 91色婷婷久久久久合中文| 精品剧情v国产在线观看在线| 一区二区三区四区乱视频| 国产伦精品一区二区三区在线观看| 欧美亚男人的天堂| 亚洲国产精品成人综合 | 欧美成人免费网站| 一区二区三区成人在线视频| 国产盗摄视频一区二区三区| 欧美日韩激情一区二区| 综合久久国产九一剧情麻豆| 激情丁香综合五月| 6080亚洲精品一区二区| 伊人性伊人情综合网| 成人av午夜电影| 精品三级在线观看| 日本在线不卡一区| 在线亚洲一区二区| 国产精品美女视频| 国产精品一区二区在线播放| 日韩一区二区中文字幕| aaa亚洲精品| 久久久99精品久久| 狠狠色综合播放一区二区| 欧美日韩国产美女| 一区二区三区中文在线| 国产成人福利片| 精品国产sm最大网站| 美女视频黄频大全不卡视频在线播放| 91国偷自产一区二区开放时间| 欧美激情一二三区| 国产一区二区三区四区五区美女 | 久久av中文字幕片| 91精品国产色综合久久不卡蜜臀 | eeuss国产一区二区三区| 久久久久国产精品麻豆ai换脸 | 激情综合一区二区三区| 日韩欧美成人一区| 日韩激情视频网站| 欧美亚洲动漫制服丝袜| 亚洲午夜精品在线| 在线观看日韩电影| 亚洲一区二区综合| 欧美精品自拍偷拍动漫精品| 亚洲一区二区五区| 欧美日高清视频| 五月婷婷另类国产| 欧美久久一二区| 五月天激情综合| 欧美一区二区播放| 麻豆91在线观看| 久久这里只有精品视频网| 久久99精品久久久久久| 久久久久久久性| 国产在线精品一区在线观看麻豆| 精品欧美一区二区久久| 激情成人综合网| 国产精品精品国产色婷婷| 91老师国产黑色丝袜在线| 亚洲国产精品久久人人爱| 91精品在线免费| 国产老肥熟一区二区三区| 亚洲欧美在线高清| 欧美日韩国产首页| 精品一区二区三区免费播放| 国产欧美日韩综合| 欧美性视频一区二区三区| 免费观看在线综合| 久久精品一区二区三区四区| 92国产精品观看| 日本系列欧美系列| 国产高清久久久| 亚洲综合色成人| 欧美一级视频精品观看| 国产激情视频一区二区在线观看 | 成人免费在线播放视频| 在线观看亚洲精品视频| 免费成人美女在线观看.| 欧美激情一区二区三区不卡| 91麻豆自制传媒国产之光| 亚洲国产aⅴ成人精品无吗| 日韩欧美国产麻豆| 成人精品电影在线观看| 天天综合天天综合色| 欧美精彩视频一区二区三区| 色婷婷综合久久| 激情欧美一区二区| 亚洲精品欧美在线| 精品欧美乱码久久久久久1区2区| 99国产精品久| 久久99久久精品欧美| 日韩一区在线免费观看| 欧美精品久久天天躁| 国产麻豆精品在线| 爽好多水快深点欧美视频| 国产欧美一区二区三区鸳鸯浴| 欧美日韩国产在线观看| 国产成人高清视频| 日本美女一区二区| 亚洲欧洲综合另类| 久久先锋资源网| 精品视频999| av动漫一区二区| 国产在线国偷精品免费看| 亚洲午夜在线电影| 中文幕一区二区三区久久蜜桃| 911国产精品|