⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 shockwaveflash.cpp

📁 看一下
💻 CPP
字号:
// Machine generated IDispatch wrapper class(es) created by Microsoft Visual C++

// NOTE: Do not modify the contents of this file.  If this class is regenerated by
//  Microsoft Visual C++, your modifications will be overwritten.


#include "stdafx.h"
#include "ShockwaveFlash.h"
#include ".\shockwaveflash.h"

/////////////////////////////////////////////////////////////////////////////
// ShockwaveFlash

IMPLEMENT_DYNCREATE(ShockwaveFlash, CWnd)

/////////////////////////////////////////////////////////////////////////////
// ShockwaveFlash properties
long ShockwaveFlash::s_lCount = 0;
/////////////////////////////////////////////////////////////////////////////
// ShockwaveFlash operations
ShockwaveFlash::ShockwaveFlash()
{
#if 0
	if (0 == InterlockedExchangeAdd((volatile long *)&s_lCount, 1))
	{
		CString szOxPath(GetModulePath() + "Flash8.ocx");
		
		HMODULE	hmod=LoadLibrary (szOxPath);
		ASSERT(hmod);
		if (hmod)
		{
			FARPROC  pReg =GetProcAddress (hmod,"DllRegisterServer");
			(*pReg)();
		}
	}
#endif

	m_bHasInit = FALSE;
	m_lOldProc = 0;
}

ShockwaveFlash::~ShockwaveFlash()
{
#if 0
	if (1 == InterlockedExchangeAdd((volatile long *)&s_lCount, -1))
	{
		CString szOxPath(GetModulePath() + "Flash8.ocx");

		HMODULE	hmod=LoadLibrary (szOxPath);
		ASSERT(hmod);
		if (hmod)
		{
			FARPROC  pReg =GetProcAddress (hmod,"DllUnregisterServer");
			(*pReg)();
		}
	}
#endif
}

LRESULT ShockwaveFlash::FlashWinProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
	ShockwaveFlash *pFlashCtrl = (ShockwaveFlash *)FromHandle(hWnd);
	ASSERT(pFlashCtrl);

	//屏蔽或修改右键菜单
	if(msg == WM_RBUTTONDOWN)
	{
		//ShockwaveFlash *pFlashCtrl = (ShockwaveFlash *)FromHandle(hWnd);
		//ASSERT(pFlashCtrl);
		//pFlashCtrl->SetVariable("_root.g_Protocol.win_data", "<win_app style = '2'><item name = '司强的测试房间' width = '1000'/></win_app>");

		return 0;
	}

	//调用原来的窗口过程
	return CallWindowProc((WNDPROC)(pFlashCtrl->m_lOldProc), hWnd, msg, wParam, lParam); 
}

BOOL ShockwaveFlash::Init()
{
	if (FALSE == m_bHasInit)
	{
		m_lOldProc = SetWindowLong(m_hWnd, GWL_WNDPROC, (long)FlashWinProc);
	}

	m_bHasInit = TRUE;

	return TRUE;
}

CString ShockwaveFlash::GetModulePath()
{
	CString strPath;
	char szPath[MAX_PATH +1];
	UINT uPathLen = 0;

	uPathLen = GetModuleFileName(NULL, szPath, MAX_PATH);
	while (uPathLen > 0)
	{
		if ('\\' == szPath[uPathLen])
		{
			szPath[uPathLen +1] = NULL;
			break;
		}
		uPathLen --;
	}	
	strPath = szPath;
	return strPath;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -