开发工具:
文件大小: 352kb
下载次数: 0
上传时间: 2010-12-11
详细说明: 对日常债务进行数据库操作 .586 .model flat,stdcall option casemap:none include pay.inc include p_Func.asm include p_const.asm include p_struct.asm include p_data.asm include macro.mac .data hInstance HINSTANCE ? CommandLine LPSTR ? hParent dword ? hCursor dword ? hconn_g dword ? henv_g dword ? hstmt_g dword ? dwCount_g dword ? bFlag_g dword ? pPayForData_g PAYFORDATA <> pConfigData CONFIGDATA <> .code include p_code.asm include p_db .asm include p_Dialog.asm include p_ListView.asm include P_ini.asm include p_html.asm ; --------------------------------------------------------------------------- start: invoke GetModuleHandle, NULL mov hInstance,eax invoke DialogBoxParam,hInstance,addr LoginDlgName,0,addr LoginDialog,NULL .if bFlag_g invoke GetCommandLine mov CommandLine,eax invoke WinMain, hInstance,NULL,CommandLine, SW_SHOWDEFAULT .endif invoke ExitProcess,eax WinMain proc hInst:HINSTANCE,hPrevInst:HINSTANCE,CmdLine:LPSTR,CmdShow:DWORD LOCAL wc:WNDCLASSEX LOCAL msg:MSG LOCAL hwnd:HWND LOCAL hMenu:HWND LOCAL hAccelerator:HWND mov wc.cbSize,SIZEOF WNDCLASSEX mov wc.style, CS_HREDRAW or CS_VREDRAW mov wc.lpfnWndProc, OFFSET WndProc mov wc.cbClsExtra,NULL mov wc.cbWndExtra,NULL push hInstance pop wc.hInstance mov wc.hbrBackground,COLOR_BTNFACE+1 mov wc.lpszMenuName,offset MenuName mov wc.lpszClassName,OFFSET ClassName invoke LoadIcon,NULL,IDI_MAIN_ICON mov wc.hIcon,eax mov wc.hIconSm,eax mov hMainIco,eax invoke LoadMenu,hInstance,IDR_MENU mov hMenu,eax invoke LoadCursor,NULL,IDC_ARROW mov wc.hCursor,eax invoke LoadCursor,hInstance,IDI_HANDLE_ICON mov hCursor,eax invoke LoadAccelerators,hInstance,IDA_ACCELERATOR mov hAccelerator,eax invoke RegisterClassEx, addr wc INVOKE CreateWindowEx,NULL,ADDR ClassName,ADDR AppName,\ WS_OVERLAPPEDWINDOW,CW_USEDEFAULT,\ CW_USEDEFAULT,CW_USEDEFAULT,CW_USEDEFAULT,NULL,hMenu,\ hInst,NULL mov hwnd,eax mov hParent,eax invoke ShowWindow, hwnd,SW_SHOWNORMAL invoke UpdateWindow, hwnd .WHILE TRUE invoke GetMessage, ADDR msg,NULL,0,0 .BREAK .IF (!eax) invoke TranslateAccelerator,hwnd,hAccelerator,addr msg .if eax == 0 invoke TranslateMessage, ADDR msg invoke DispatchMessage, ADDR msg .endif .ENDW mov eax,msg.wParam ret WinMain endp WndProc proc uses ebx hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM local @stFont:LOGFONT,@hFont:DWORD LOCAL @dwColor:dword .IF uMsg==WM_DESTROY invoke KillTimer,hWnd,IDC_TIMER_STATUSBAR invoke PostQuitMessage,NULL .elseif uMsg==WM_TIMER .if wParam==IDC_TIMER_STATUSBAR invoke _PrintMsg_3 .endif .ELSEIF uMsg==WM_CREATE invoke SetTimer,hWnd,IDC_TIMER_STATUSBAR ,1000,NULL invoke LoadIcon,hInstance,IDI_MAIN_ICON invoke SendMessage, hWnd, WM_SETICON, ICON_BIG,eax ;control invoke _DoToolBar,hInstance,hWnd,IDC_MAIN_TB mov hToolBar,eax ;invoke _DoEdit,hInstance,hToolBar,IDC_MAIN_EDIT ;mov hEdit,eax ;invoke _DoButton,hInstance,hToolBar,IDC_MAIN_BUTTON,_T("搜索") ;mov hButton,eax ;LABEL invoke _DoLabel,hInstance,hToolBar,IDC_BTN_LABEL_3,200,3,150,20 invoke SetDlgItemText,hToolBar,IDC_BTN_LABEL_3,_T("当前用户:") invoke _DoLabel,hInstance,hToolBar,IDC_BTN_LABEL_NAME,270,3,150,20 invoke _DoLabel,hInstance,hToolBar,IDC_BTN_LABEL_1,340,3,150,20 invoke SetDlgItemText,hToolBar,IDC_BTN_LABEL_1,_T("借入:") invoke _DoLabel,hInstance,hToolBar,IDC_BTN_LABEL_IN,380,3,150,20 invoke _DoLabel,hInstance,hToolBar,IDC_BTN_LABEL_2,480,3,150,20 invoke SetDlgItemText,hToolBar,IDC_BTN_LABEL_2,_T("借出:") invoke _DoLabel,hInstance,hToolBar,IDC_BTN_LABEL_OUT,520,3,150,20 invoke _DoStatusBar,hInstance,hWnd,IDC_MAIN_SB mov hStatusBar,eax invoke _DoListView,hInstance,hWnd,IDC_MAIN_LSV mov hListView ,eax invoke _InsertColumnToMainListV,hListView invoke _DoPopupMainMenu, hInstance,hWnd mov hPopupMainMenu,eax invoke _InitConfig,hWnd .elseif uMsg==WM_NOTIFY push edi mov edi, lParam mov eax, [edi.NMHDR].hwndFrom .if eax==hListView .if [edi.NMHDR].code==NM_DBLCLK ;双击 .elseif [edi.NMHDR].code==NM_CLICK ;单击 invoke _GetCurrentFocus,hListView,addr pPayForData_g .elseif [edi.NMHDR].code==NM_RCLICK ;右击 invoke _GetCurrentFocus,hListView,addr pPayForData_g invoke _ShowPopupMainMenu,hWnd,hPopupMainMenu .endif .endif pop edi .elseif uMsg==WM_COMMAND .if lParam !=0 ;工具栏 LOWORD wParam .if eax==IDC_TBB_NEW invoke DialogBoxParam,hInstance,addr NewDlgName,hWnd,addr IddNewDialog,NULL .elseif eax==IDC_TBB_SEE invoke DialogBoxParam,hInstance,addr SeeDlgName,hWnd,addr SeeDialog,NULL .elseif eax==IDC_TBB_PRINT invoke _Print_Html,hWnd .elseif eax==IDC_TBB_HELP invoke DialogBoxParam,hInstance,addr AboutDlgName,hWnd,addr AboutDialog,NULL .elseif eax==IDC_TBB_EXIT invoke SendMessage,hWnd,WM_CLOSE,0,0 .endif .elseif lParam ==0 HIWORD wParam .if eax==0 ;菜单栏 mov eax,wParam .if ax==IDM_NEW invoke DialogBoxParam,hInstance,addr NewDlgName,hWnd,addr IddNewDialog,NULL invoke _RefreshMTData,hWnd,hListView .elseif ax==IDM_SEE invoke DialogBoxParam,hInstance,addr SeeDlgName,hWnd,addr SeeDialog,NULL .elseif ax==IDM_PRINT invoke _Print_Html,hWnd .elseif ax==IDM_CALC invoke _OpenProgramExeFile,hWnd,addr SZCALC,NULL .elseif ax==IDM_HELP invoke DialogBoxParam,hInstance,addr AboutDlgName,hWnd,addr AboutDialog,NULL .elseif ax==IDM_PWD invoke DialogBoxParam,hInstance,addr PwdDlgName,hWnd,addr PwdDialog,NULL .elseif ax==IDM_REFRESH invoke _RefreshMTData,hWnd,hListView .elseif ax==IDM_DEMO invoke DialogBoxParam,hInstance,addr DemoDlgName,hWnd,addr DemoDialog,NULL .elseif ax==IDM_CAL invoke _PromptMsg,_T("建设中...") .endif .elseif eax==1 ;快捷键 .endif .endif .elseif uMsg ==WM_SIZE .if wParam!=SIZE_MINIMIZED invoke SendMessage,hStatusBar,uMsg,wParam,lParam invoke SendMessage,hToolBar,uMsg,wParam,lParam mov eax,lParam mov edx,eax and eax,0ffffh shr edx,16 sub edx,46 invoke MoveWindow,hListView, 0, 28, eax,edx,TRUE mov eax,lParam and eax,0ffffh mov ebx,eax sub eax,210 sub ebx,55 invoke MoveWindow,hEdit, eax, 3,150,20,TRUE invoke MoveWindow,hButton,ebx, 3,50,20,TRUE .endif .elseif uMsg==WM_SIZING LimitWindowWidth 455 LimitWindowHeight 455 .ELSE invoke DefWindowProc,hWnd,uMsg,wParam,lParam ret .ENDIF xor eax,eax ret WndProc endp _RefreshMTData proc hWnd:dword,hOwner:dword pushad ;连接数据库 invoke DBConnect,hWnd .if eax invoke _PrintMsg_1,_T("数据库连接成功!") .endif ;显示数据 invoke SQLExecDirect,hstmt_g,addr SHOW_ALL_RECODE_MT,sizeof SHOW_ALL_RECODE_MT .if ax==SQL_SUCCESS || ax==SQL_SUCCESS_WITH_INFO ;73570000h invoke _ReadMTToMainListV,hOwner,hstmt_g mov dwCount_g,eax invoke _PrintMsg_2,dwCount_g,_T(" ") invoke _PrintMsg_1,_T("加载成功!") .endif invoke DisDBConnect,hWnd .if eax invoke _PrintMsg_1,_T("断开与数据库的连接!") .endif popad ret _RefreshMTData endp _RefreshOPData proc hWnd:dword,hOwner:dword LOCAL @nCount:dword pushad ;连接数据库 invoke DBConnect,hWnd .if eax invoke _PrintMsg_1,_T("数据库连接成功!") .endif ;显示数据 invoke SQLExecDirect,hstmt_g,addr SHOW_ALL_RECODE_OP,sizeof SHOW_ALL_RECODE_OP .if ax==SQL_SUCCESS || ax==SQL_SUCCESS_WITH_INFO ;73570000h invoke _ReadOPToSeeListV,hOwner,hstmt_g mov @nCount,eax invoke _SetGroupText,hWnd,@nCount invoke _PrintMsg_1,_T("加载成功!") .endif invoke DisDBConnect,hWnd .if eax invoke _PrintMsg_1,_T("断开与数据库的连接!") .endif popad ret _RefreshOPData endp _InitConfig proc hWnd:dword LOCAL @Buff[MAX_PATH]:byte pushad invoke _RefreshMTData,hWnd,hListView invoke SetDlgItemText,hToolBar,IDC_BTN_LABEL_NAME,addr pConfigData.szName invoke _CalcMTPayForRecord,hWnd,addr pConfigData.szName,FALSE mov dwMoneyIn,eax invoke wsprintf,addr @Buff,addr szMoney,dwMoneyIn invoke SetDlgItemText,hToolBar,IDC_BTN_LABEL_IN,addr @Buff invoke _CalcMTPayForRecord,hWnd,addr pConfigData.szName,TRUE mov dwMoneyOut,eax invoke wsprintf,addr @Buff,addr szMoney,dwMoneyOut invoke SetDlgItemText,hToolBar,IDC_BTN_LABEL_OUT,addr @Buff ;TITLE invoke RtlZeroMemory,addr @Buff,sizeof @Buff invoke lstrcpy,addr @Buff,addr pConfigData.szAppName invoke lstrcat,addr @Buff,_T(" -- ") invoke lstrcat,addr @Buff,addr pConfigData.szName invoke SendMessage,hWnd,WM_SETTEXT,0,addr @Buff popad ret _InitConfig endp end start ...展开收缩
(系统自动生成,下载前可以参看下载内容)
下载文件列表
相关说明
- 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
- 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度。
- 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
- 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
- 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
- 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.