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

📄 pb_serch_dialog.c

📁 基于minigui的智能手机pda源码
💻 C
字号:
#include "../sys_headfile.h"
#include "pb_main.h"
#define IDC_SER_NAME           0xc001
#define IDC_SER_NAME_EDIT               0xc002
#define IDC_SER_BUTTON_OK   0xc005
#define IDC_SER_BUTTON_CANCEL  0xc006


CTRLDATA searchCTRALDATA[]=
{
        {
                CTRL_STATIC,
                WS_VISIBLE,
                10,10,40,20,
                IDC_SER_NAME,
                "姓名:",
                0
        },
        
	{
                CTRL_SLEDIT,
                WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP,
                80,10,110,20,
                IDC_SER_NAME_EDIT,
                "",
                0
        },
        
        
        {
                "button",
                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                33, 68, 74, 23,
                IDC_SER_BUTTON_OK,
                "确定",
                0
        },

        {
                "button",
                WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON,
                129, 68, 74, 23,
                IDC_SER_BUTTON_CANCEL,
                "取消",
                0
        }				
};

DLGTEMPLATE SeaDlg = 
{
        WS_VISIBLE | WS_CAPTION | WS_BORDER,
        WS_EX_NONE,
        45, 31, 235, 120,
        "查找号码",
        0, 0,
        4, searchCTRALDATA,
        0
};

/*******************************************************************************/

static int searchContactWinProc(HWND hDlg, int message, WPARAM wParam, LPARAM lParam)
{
    static struct tempData *temp;
    switch (message) {
        case MSG_INITDIALOG:{

                   temp = (struct tempData*) lParam;
		}break;

        case MSG_COMMAND:
        {
	    switch(wParam){	
	        case IDC_SER_BUTTON_OK: {

			   HWND hWnd_temp;
			   int len;
		          hWnd_temp = GetDlgItem (hDlg, IDC_SER_NAME_EDIT);                              
		          len = GetWindowTextLength(hWnd_temp);                                  
		          if(len == 0)                                                                
		          {
                              MessageBox (hDlg, "请输入姓名", "错误", MB_OK | MB_ICONINFORMATION);
                              break;
			     
                         }
		           
		           GetWindowText(hWnd_temp,temp->contactName, 20);
		          
			    EndDialog (hDlg, 0);
	        }break;
	        case IDC_SER_BUTTON_CANCEL:{
               EndDialog(hDlg,0);
	        }break;
	    }
        }
		
        break;

    case MSG_CLOSE:
        {
	    EndDialog (hDlg, 0);
        }
        return 0;
    }

    return DefaultDialogProc (hDlg, message, wParam, lParam);
}
void searchDlg(HWND hWnd)
{  
	DialogBoxIndirectParam (&SeaDlg, hWnd, searchContactWinProc, (LPARAM)&contactTemp);
}

⌨️ 快捷键说明

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