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

📄 wince_initwnd.cpp

📁 这个是延伸mame的在wince平台下的游戏模拟器的代码
💻 CPP
字号:
/* PocketCultMAME - MAME Emulator for PocketPC
   (c) Copyright 2006 Manuel Castrillo Mart韓ez

   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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
#include <windows.h>
#include <windowsx.h>
#include <wingdi.h>
#include <aygshell.h>
#include <commctrl.h>
#include <winuser.h>

#include "wince_initWnd.h"
#include "resource.h"

extern HINSTANCE g_hInstance;
extern HWND hWnd;

extern "C"
{
	int initWndActive = 0;
}

HDC hdc_init;
HWND hWnd_init;

LRESULT CALLBACK WndInitProc( HWND hWndp, UINT message, WPARAM wParam, LPARAM lParam );


void createInitWindow(void)
{
	hWnd_init = CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_dlgInitializationResult), hWnd, (DLGPROC)WndInitProc);    
	ShowWindow(hWnd_init, SW_SHOWNORMAL);
	UpdateWindow(hWnd_init);
	initWndActive = 1;
}


void closeInitWindow(void)
{
	initWndActive = 0;
	DestroyWindow(hWnd_init);
}


void sendInitializationText( char *logText )
{
	wchar_t txtBuf[2048];
	wchar_t line[512];
	HWND textControl;

	textControl = GetDlgItem(hWnd_init, IDC_txtResult);

	mbstowcs( line, logText, 512);

	Edit_GetText(textControl, txtBuf, sizeof(txtBuf));
	wcscat( txtBuf, line );
	wcscat( txtBuf, _T("\x0D\x0A") );
	Edit_SetText(textControl, txtBuf );
	Edit_ScrollCaret(textControl);
	Edit_Scroll(textControl, Edit_GetLineCount(textControl), 0);
	UpdateWindow(hWnd_init);
}


LRESULT CALLBACK WndInitProc( HWND hWndp, UINT message, WPARAM wParam, LPARAM lParam )
{
	
	PAINTSTRUCT ps;

	switch (message) {
		case WM_COMMAND:
			switch( LOWORD(wParam) )
			{
				case IDC_btnClose:
					closeInitWindow();
					return TRUE;
			}
			break;

		case WM_CREATE:
			break;

		case WM_ACTIVATE:
			break;

		case WM_KILLFOCUS:
			break;

		case WM_SETFOCUS:
			break;

		case WM_PAINT:
			if (GetForegroundWindow() == hWndp) {
				hdc_init = BeginPaint(hWndp, &ps);
				EndPaint(hWndp, &ps);
			}
			break;

		case WM_QUIT:
			initWndActive = 0;
			break;

		default:
			return DefWindowProc(hWndp, message, wParam, lParam);
	}

	return 0;

}

⌨️ 快捷键说明

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