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

📄 first_info.c

📁 自己学习时写的检测minigui的代码 希望可以帮助别人 我也是初学者
💻 C
字号:

#include "first.h"

static void InitDialog(HWND hWnd);
static int InitDialogProc (HWND hDlg ,int message ,WPARAM wParam,LPARAM lParam);


static DLGTEMPLATE DlgNewInfo = 
{
	WS_VISIBLE | WS_CAPTION | WS_BORDER ,
	WS_EX_NONE ,
	120,180,400,160,
	"The new information  : ",
	0,
	0,
	5,
	NULL,
	0
};
static CTRLDATA  CtrlNewInfo []= 
{
	{
		"static",
		WS_VISIBLE,
		10,10,380,16,
		ID_DLGPROMOTEINFOCTRL,
		"Information : ",
		0
	},
	{
		"textedit",
		WS_CHILD | WS_VISIBLE | WS_BORDER,
		10,40,155,40,
		ID_DLGNEWINFOCTRL1,
		"",
		0
	},
	{
		"textedit",
		WS_CHILD | WS_VISIBLE | WS_BORDER,
		175,40,155,40,
		ID_DLGNEWINFOCTRL2,
		"",
		0
	},
	{
		"button",
		WS_VISIBLE |WS_BORDER,
		100,94,70,28,
		ID_DLGOKINFOCTRL,
		"OK",
		0
	},
	{
		"button",
		WS_VISIBLE | WS_BORDER,
		200,94,70,28,
		ID_DLGCANCLEINFOCTRL,
		"Cancle",
		0
	}
};
	


static void InitDialog(HWND hWnd)
{
	DlgNewInfo.controls = CtrlNewInfo;
	DialogBoxIndirectParam (&DlgNewInfo ,hWnd , InitDialogProc,0L);
	printf("Use the Dialogue .......");
}

static int InitDialogProc (HWND hDlg ,int message ,WPARAM wParam,LPARAM lParam)
{
	char *str1;
	int 	*len1;
	char *str2;
	int   	*len2;
	switch(message)
	{
		case MSG_INITDIALOG:
			return 1;
		case MSG_COMMAND:
			
			if(LOWORD(wParam) == ID_DLGOKINFOCTRL)
			{
				str1 = GetDlgItemText2(hDlg , ID_DLGNEWINFOCTRL1,len1);
				str2 = GetDlgItemText2(hDlg , ID_DLGNEWINFOCTRL2,len2);
				printf ("The information is %s" , str1);
				printf ("\n\t %s",str2);
			}		
			if(LOWORD(wParam) == ID_DLGCANCLEINFOCTRL)
			{
				EndDialog (hDlg,wParam);
				printf("\nUse the Cancle\n");
			}
		break;		
	}	
	return DefaultDialogProc (hDlg,message,wParam,lParam);
}

⌨️ 快捷键说明

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