about.c

来自「dtelent是开源的开发项目」· C语言 代码 · 共 55 行

C
55
字号
/* about.c
 * Copyright (C) 1998 David Cole
 *
 * Implement the About dialog
 */
#include <windows.h>

#include "platform.h"
#include "resource.h"
#include "about.h"
#include "dtelnet.h"
#include "dialog.h"

static BOOL haveDialog;		/* have we created the About dialog? */

/* Dialog procedure for the About dialog
 */
BOOL CALLBACK aboutDlgProc(HWND dlg,
			   UINT message, WPARAM wparam, LPARAM lparam)
{
    switch (message) {
    case WM_INITDIALOG:
	/* Flag that we have created the dialog, and register the
	 * dialog window handle with the dialog handling code.
	 */
	haveDialog = TRUE;
	dialogRegister(dlg);
	return TRUE;

    case WM_COMMAND:
	switch (LOWORD (wparam)) {
	case IDOK:
	case IDCANCEL:
	    /* Destroy the dialog and unregister the dialog handle
	     * with the dialog handling code.
	     */
	    DestroyWindow(dlg);
	    dialogUnRegister(dlg);
	    haveDialog = FALSE;
	    return TRUE;
	}
	break;
    }
    return FALSE;
}

/* Called when the user invokes the About dialog
 */
void aboutShowDialog(HINSTANCE instance, HWND wnd)
{
    if (!haveDialog)
	CreateDialog(instance, MAKEINTRESOURCE(IDD_ABOUT_DIALOG),
		     wnd, aboutDlgProc);
}

⌨️ 快捷键说明

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