win32mainwnd.cpp

来自「PPC流行的播放软件gsplayer源码2.24版」· C++ 代码 · 共 49 行

CPP
49
字号
#include "GSPlayer2.h"
#include "Win32MainWnd.h"
#include "Win32Options.h"

CWin32MainWnd::CWin32MainWnd()
{
}

CWin32MainWnd::~CWin32MainWnd()
{
}

COptions* CWin32MainWnd::GetOptionsClass()
{
	return new CWin32Options();
}

void CWin32MainWnd::OnCreate(HWND hWnd)
{
	CMainWnd::OnCreate(hWnd);

	// 摟柧壔偡傞
	SetWindowLong(m_hWnd, GWL_EXSTYLE, GetWindowLong(m_hWnd, GWL_EXSTYLE) | WS_EX_LAYERED);
	BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE bAlpha, DWORD);
	pSetLayeredWindowAttributes = NULL;
	HINSTANCE hInstDll = (HINSTANCE)LoadLibrary(_T("user32.dll"));
	if (hInstDll) {
		(FARPROC&)pSetLayeredWindowAttributes = GetProcAddress(hInstDll, "SetLayeredWindowAttributes");
		if (pSetLayeredWindowAttributes)
			pSetLayeredWindowAttributes(m_hWnd, 0, ((CWin32Options*)m_pOptions)->m_nWndAlpha, LWA_ALPHA);
		FreeLibrary(hInstDll);
	}
}

void CWin32MainWnd::OnToolOption()
{
	CMainWnd::OnToolOption();

	// 摟柧壔偡傞
	BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE bAlpha, DWORD);
	pSetLayeredWindowAttributes = NULL;
	HINSTANCE hInstDll = (HINSTANCE)LoadLibrary(_T("user32.dll"));
	if (hInstDll) {
		(FARPROC&)pSetLayeredWindowAttributes = GetProcAddress(hInstDll, "SetLayeredWindowAttributes");
		if (pSetLayeredWindowAttributes)
			pSetLayeredWindowAttributes(m_hWnd, 0, ((CWin32Options*)m_pOptions)->m_nWndAlpha, LWA_ALPHA);
		FreeLibrary(hInstDll);
	}
}

⌨️ 快捷键说明

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