//foods_notif_Comin_SJ
static void foods_notif_Comin_SJ(HWND hWnd,int id,int nc,DWORD add_data)
{
if(nc==LBN_CLICKED||nc==LBN_ENTER)
{
int clickn=SendMessage(hWnd,LB_GETCURSEL,0,0L);
if(clickn>=0)
{
char string[50]; SendMessage(hWnd,LB_GETTEXT,clickn,(LPARAM)JS_del);
}
}
}
static void foods_notif_Del_SJ(HWND hWnd,int id,int nc,DWORD add_data)
{
int nrow=0,ncolumn=0,j=1;
char value[100],*errmsg,**result;
//DELETE FROM t1 WHERE a='%s' ",del);
sprintf(value,"DELETE FROM t3 where jsname='%s'",JS_del);
sqlite3_exec(db,value,0,0,errmsg);
SendDlgItemMessage (GetParent(hWnd),Comin_JS_ID, LB_RESETCONTENT, 0, (LPARAM)0);
sqlite3_get_table(db,"select * from t3",&result,&nrow,&ncolumn,&errmsg);
for(j;j<(nrow+1)*ncolumn;j++)
{
SendDlgItemMessage(GetParent(hWnd),Comin_JS_ID,LB_ADDSTRING,0,result[j]);
}
sqlite3_free_table(result);
}
//返回主页面
static void foods_notif_return(HWND hWnd,int id,int nc,DWORD add_data)
{
}
static int WinProcc(HWND hWnd,int message,WPARAM wParam,LPARAM IParam)
{
HWND hwnd,hwnd1;
HDC hdc;
switch(message)
{
case MSG_ERASEBKGND:
{
HDC hdc = (HDC)wParam;
const RECT* clip = (const RECT*)IParam;
BOOL fGetDC = FALSE;
RECT rcTemp;
if (hdc == 0) {
hdc = GetClientDC (hWnd);
fGetDC = TRUE;
}
if (clip) {
rcTemp = *clip;
ScreenToClient (hWnd, &rcTemp.left, &rcTemp.top);
ScreenToClient (hWnd, &rcTemp.right, &rcTemp.bottom);
IncludeClipRect (hdc, &rcTemp);
}
FillBoxWithBitmap (hdc, 0, 0,640, 480, &bmp_bkgnd);
if (fGetDC)
ReleaseDC (hdc);
return 0;
}
case MSG_CREATE:
case MSG_TIMER:
case MSG_COMMAND:
switch(wParam)
{
case IDM_EXIT:
InvalidateRect(hWnd,NULL,TRUE);
show_win(hWnd,0);
initdish(hWnd,"粤 菜",dish_tosec);
fill_food(hWnd,dish,dish_tosec);
break;
case IDM_ABOUT:
show_win(hWnd,1);
// calue(hWnd);
//MessageBox(hWnd,"已点菜列表^_^","About",MB_OK);
break;
case IDM_ABOUT1:
show_win(hWnd,2);
InvalidateRect(hWnd,NULL,TRUE);
MessageBox(hWnd,"酒水","About1",MB_OK);
break;
case IDM_ABOUT2 :
MessageBox(hWnd,"结帐","About1",MB_OK);
show_win(hWnd,3);
JIEZHANG(hWnd);
break;
case MSG_CLOSE:
DestroyMainWindow(hWnd);
PostQuitMessage(hWnd);
break;
}
/* case MSG_PAINT:
hdc=BeginPaint(hWnd);
//TextOut(hdc,300,180,"wellcome to here\n");
EndPaint(hWnd,hdc);
break; */
default :
return(DefaultMainWinProc(hWnd,message,wParam,IParam));
}
return 0;
}
int InitMainWindow(void)
{
}
int MiniGUIMain(int argc, const char * argv [ ])
{
InitMainWindow();
ShowWindow(hMainWnd,SW_SHOWNORMAL);
display(hMainWnd);
while(GetMessage(&Msg,hMainWnd))
{
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
MainWindowThreadCleanup(hMainWnd);
MiniGUIExtCleanUp ();
UnloadBitmap (&bmp_bkgnd);
return 0;
}
谢 辞
首先我要感谢北京理工大学珠海学院的嵌入式老师,他们给我提供了开发环境以及开发工具,感谢曾经指导过我的老师,特别是盛老师他给与了我很大的帮助和支持,在遇问题时,盛老师给我解决问题的思路方法,引导我一步步去攻克难题。同时我也要感谢我实习的公司《全视通珠海信息技术有限公司》,在公司里我学到嵌入式开发流程,以及MiniGui界面开发工具的使用.