unit U_GetDllForm; interface uses Windows, Messages, forms, OleCtnrs, DateUtils, SysUtils, ADODB, IniFiles, dxCore, ActiveX; function GetDllForm(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; export; stdcall; function ConnData(): Boolean; implementation //U_ModulePromptList uses U_DataLink, U_Fun, U_iniParam, U_ContractListXF, U_ContractListXF_SH, U_ProductOrderMoneyList, U_ProductOrderNewList_JD, U_ProductOrderNewList_GDJD, U_ProductOrderNewList_HTJD, U_JGSXKNewList, U_JGSXCKOutList, U_JGPBCKKCList, U_JGSXKNewList_SH, U_JGSXKNewList_CPCK, U_JGSXKNewList_CPCKCX, U_JGSXKNewList_CPCKSH, U_JGSXKNewList_CLGLCX, U_CLManage, U_CLShuiPiao, U_CLShuiPiao_SH, U_CLYouKa, U_CLYouKa_SH, U_CaiGouSQChkList, U_CaiGouSQList, U_CaiGouSQCXList, U_JWLInChkList, U_JWLOutChkList, U_JWLKCList, U_JWLInChkCXList, U_JWLOutChkCXList, U_CLManageJBC_JiuF, U_JGSXCKOutList_DJ, U_CLYouKa_Qty, U_CLYouJS_CX, U_JGPBCKKCList_Month, U_JGPBCKKCList_MRT, U_JGPBCKKCList_JSYCX, U_CLYouKa_SHDJ, U_JGPBCKKCList_BengCheCX, U_JGSXKNewList_CPCK_HZ, U_CLYouKa_CZGCF, U_ContractListXF_WC, U_CLYouKa_GZMX, U_JWLKCList_HZ, U_ContractListXF_CX, U_CLShuiPiao_CX, U_ContractListXF_LSCX, U_JGPBCKKCList_SJGZCX, U_BCHZ_Year, U_CLManageJBC_GZMX, U_BCHZ_Year_JSYSF, U_JGSXKNewList_CLGLCXMgg, U_JGSXKNewList_CPCKMgg, U_JGSXKNewList_CLGLCXMgg_GL, U_JGSXKNewList_CLGLCX_HZMgg_GL, U_JGPBCKKCList_BengCheCXMgg,U_CCHZ_Year, U_JGPBCKKCList_JSYCXMgg, U_GDLLManage_Main, U_JBCHZ_Year, U_JWLKCList_MoneyHZ; var frmCaiGouSQListJWL, frmCaiGouSQListJWLGQX: TfrmCaiGouSQList; frmCaiGouSQChkListJWL: TfrmCaiGouSQChkList; frmCaiGouSQCXListJWL: TfrmCaiGouSQCXList; frmJWLInChkList, frmJWLInChkListJWL: TfrmJWLInChkList; frmJWLOutChkList, frmJWLOutChkListJWL: TfrmJWLOutChkList; frmJWLKCList, frmJWLKCListJWL: TfrmJWLKCList; frmJWLInChkCXList, frmJWLInChkCXListJWL: TfrmJWLInChkCXList; frmJWLOutChkCXList, frmJWLOutChkCXListJWL: TfrmJWLOutChkCXList; ///////////////////////////////////////////////////////////////// // 功能说明:取Dll中得窗体 // // 参数说明:App>>调用应用程序; // // FormH>>调用窗口句柄 ; // // FormID>>窗口号; // // Language>>语言种类; // // WinStyle>>窗口类型; // ///////////////////////////////////////////////////////////////// function GetDllForm(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; var i: Integer; bFound: Boolean; mnewHandle: hwnd; mstyle: TFormStyle; // 0:子窗口; 1:普通窗口 mstate: TWindowState; mborderstyle: TFormBorderStyle; begin mnewHandle := 0; DName := GName; DCode := GCode; DdataBase := DataBase; DTitCaption := Title; DParameters1 := Parameters1; DParameters2 := Parameters2; DParameters3 := Parameters3; DParameters4 := Parameters4; DParameters5 := Parameters5; DParameters6 := Parameters6; DParameters7 := Parameters7; DParameters8 := Parameters8; DParameters9 := Parameters9; DParameters10 := Parameters10; MainApplication := App; DCurHandle := FormH; IsDelphiLanguage := Language; Application := TApplication(App); DCurHandle := 0; //赋值链接字符串 SetLength(server, 255); SetLength(dtbase, 255); SetLength(user, 255); SetLength(pswd, 255); server := '117.149.181.112,7781'; //server:='.'; dtbase := 'ShanFengdata'; user := 'sa'; pswd := 'rightsoft@123'; //pswd:='rightsoft'; DConString := 'Provider=SQLOLEDB.1;Password=' + pswd + ';Persist Security Info=True;User ID=' + user + ';Initial Catalog=' + dtbase + ';Data Source=' + server; if trim(DataBaseStr) <> '' then DConString := DataBaseStr; //DParameters1:='高权限'; //DParameters2:=''; //DCode:='CS'; //DName:='测试'; //AILEEN //DParameters3:='FANNY'; //12 if not ConnData() then begin result := 0; exit; end; if IsINIFile() then ReadINIFile() else WriteINIFile; // 定义窗口类型 、状态 if WinStyle = 0 then begin mstyle := fsMDIChild; mstate := wsMaximized; mborderstyle := bsSizeable; end else begin mstyle := fsNormal; mstate := wsNormal; mborderstyle := bsSizeable; end; //调用子模块窗口 case FormID of 1: //订单合同 begin if frmContractList_XF = nil then begin frmContractList_XF := TfrmContractList_XF.Create(application.MainForm); with frmContractList_XF do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmContractList_XF.BringToFront; //句柄 mnewHandle := frmContractList_XF.Handle; end; 2: //订单合同 审核 begin if frmContractList_XF_SH = nil then begin frmContractList_XF_SH := TfrmContractList_XF_SH.Create(application.MainForm); with frmContractList_XF_SH do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmContractList_XF_SH.BringToFront; //句柄 mnewHandle := frmContractList_XF_SH.Handle; end; 201: //订单合同 完成 begin if frmContractList_XF_WC = nil then begin frmContractList_XF_WC := TfrmContractList_XF_WC.Create(application.MainForm); with frmContractList_XF_WC do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmContractList_XF_WC.BringToFront; //句柄 mnewHandle := frmContractList_XF_WC.Handle; end; 202: //订单合同查询 begin if frmContractList_XF_CX = nil then begin frmContractList_XF_CX := TfrmContractList_XF_CX.Create(application.MainForm); with frmContractList_XF_CX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmContractList_XF_CX.BringToFront; //句柄 mnewHandle := frmContractList_XF_CX.Handle; end; 203: //临时小方量查询 begin if frmContractList_XF_LSCX = nil then begin frmContractList_XF_LSCX := TfrmContractList_XF_LSCX.Create(application.MainForm); with frmContractList_XF_LSCX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmContractList_XF_LSCX.BringToFront; //句柄 mnewHandle := frmContractList_XF_LSCX.Handle; end; 3: //生产计划单 begin if frmProductOrderMoneyList = nil then begin frmProductOrderMoneyList := TfrmProductOrderMoneyList.Create(application.MainForm); with frmProductOrderMoneyList do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmProductOrderMoneyList.BringToFront; //句柄 mnewHandle := frmProductOrderMoneyList.Handle; end; 4: //原料入库登记 begin if frmJGSXNewList = nil then begin frmJGSXNewList := TfrmJGSXNewList.Create(application.MainForm); with frmJGSXNewList do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXNewList.BringToFront; //句柄 mnewHandle := frmJGSXNewList.Handle; end; 5: //原料入库审核 begin if frmJGSXNewList_SH = nil then begin frmJGSXNewList_SH := TfrmJGSXNewList_SH.Create(application.MainForm); with frmJGSXNewList_SH do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXNewList_SH.BringToFront; //句柄 mnewHandle := frmJGSXNewList_SH.Handle; end; 51: //原料出库登记 begin if frmJGSXCKOutList_DJ = nil then begin frmJGSXCKOutList_DJ := TfrmJGSXCKOutList_DJ.Create(application.MainForm); with frmJGSXCKOutList_DJ do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXCKOutList_DJ.BringToFront; //句柄 mnewHandle := frmJGSXCKOutList_DJ.Handle; end; 6: //柴油出库管理 begin if frmJGSXCKOutList = nil then begin frmJGSXCKOutList := TfrmJGSXCKOutList.Create(application.MainForm); with frmJGSXCKOutList do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXCKOutList.BringToFront; //句柄 mnewHandle := frmJGSXCKOutList.Handle; end; 7: //原料库存管理 begin if frmJGPBCKKCList = nil then begin frmJGPBCKKCList := TfrmJGPBCKKCList.Create(application.MainForm); with frmJGPBCKKCList do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGPBCKKCList.BringToFront; //句柄 mnewHandle := frmJGPBCKKCList.Handle; end; 71: //原料月报表查询 begin if frmJGPBCKKCList_Month = nil then begin frmJGPBCKKCList_Month := TfrmJGPBCKKCList_Month.Create(application.MainForm); with frmJGPBCKKCList_Month do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGPBCKKCList_Month.BringToFront; //句柄 mnewHandle := frmJGPBCKKCList_Month.Handle; end; 8: //成品发货登记 begin if frmJGSXKNewList_CPCKMgg = nil then begin frmJGSXKNewList_CPCKMgg := TfrmJGSXKNewList_CPCKMgg.Create(application.MainForm); with frmJGSXKNewList_CPCKMgg do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXKNewList_CPCKMgg.BringToFront; //句柄 mnewHandle := frmJGSXKNewList_CPCKMgg.Handle; end; 9: //成品发货审核 begin if frmJGSXNewList_CPCKSH = nil then begin frmJGSXNewList_CPCKSH := TfrmJGSXNewList_CPCKSH.Create(application.MainForm); with frmJGSXNewList_CPCKSH do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXNewList_CPCKSH.BringToFront; //句柄 mnewHandle := frmJGSXNewList_CPCKSH.Handle; end; 10: //成品发货查询 begin if frmJGSXNewList_CPCKCX = nil then begin frmJGSXNewList_CPCKCX := TfrmJGSXNewList_CPCKCX.Create(application.MainForm); with frmJGSXNewList_CPCKCX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXNewList_CPCKCX.BringToFront; //句柄 mnewHandle := frmJGSXNewList_CPCKCX.Handle; end; 11: //车辆信息管理 begin if frmCLManage = nil then begin frmCLManage := TfrmCLManage.Create(application.MainForm); with frmCLManage do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLManage.BringToFront; //句柄 mnewHandle := frmCLManage.Handle; end; 12: //成品发货年月日汇总查询 begin if frmJGSXNewList_CLGLCX = nil then begin frmJGSXNewList_CLGLCX := TfrmJGSXNewList_CLGLCX.Create(application.MainForm); with frmJGSXNewList_CLGLCX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXNewList_CLGLCX.BringToFront; //句柄 mnewHandle := frmJGSXNewList_CLGLCX.Handle; end; 1202: //工程管理 begin if frmJGSXKNewList_CLGLCX_HZMgg_GL = nil then begin frmJGSXKNewList_CLGLCX_HZMgg_GL := TfrmJGSXKNewList_CLGLCX_HZMgg_GL.Create(application.MainForm); with frmJGSXKNewList_CLGLCX_HZMgg_GL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGSXKNewList_CLGLCX_HZMgg_GL.BringToFront; //句柄 mnewHandle := frmJGSXKNewList_CLGLCX_HZMgg_GL.Handle; end; 13: //水票登记 begin if frmCLShuiPiao = nil then begin frmCLShuiPiao := TfrmCLShuiPiao.Create(application.MainForm); with frmCLShuiPiao do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLShuiPiao.BringToFront; //句柄 mnewHandle := frmCLShuiPiao.Handle; end; 14: //水票审核 begin if frmCLShuiPiao_SH = nil then begin frmCLShuiPiao_SH := TfrmCLShuiPiao_SH.Create(application.MainForm); with frmCLShuiPiao_SH do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLShuiPiao_SH.BringToFront; //句柄 mnewHandle := frmCLShuiPiao_SH.Handle; end; 140: //水票查询 begin if frmCLShuiPiao_CX = nil then begin frmCLShuiPiao_CX := TfrmCLShuiPiao_CX.Create(application.MainForm); with frmCLShuiPiao_CX do begin caption := Trim(Title); FormID := '2'; FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLShuiPiao_CX.BringToFront; //句柄 mnewHandle := frmCLShuiPiao_CX.Handle; end; 15: //油卡充值登记 begin if frmCLYouKa = nil then begin frmCLYouKa := TfrmCLYouKa.Create(application.MainForm); with frmCLYouKa do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouKa.BringToFront; //句柄 mnewHandle := frmCLYouKa.Handle; end; 16: //油卡充值审核 begin if frmCLYouKa_SH = nil then begin frmCLYouKa_SH := TfrmCLYouKa_SH.Create(application.MainForm); with frmCLYouKa_SH do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouKa_SH.BringToFront; //句柄 mnewHandle := frmCLYouKa_SH.Handle; end; 161: //油卡油量登记 begin if frmCLYouKa_Qty = nil then begin frmCLYouKa_Qty := TfrmCLYouKa_Qty.Create(application.MainForm); with frmCLYouKa_Qty do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouKa_Qty.BringToFront; //句柄 mnewHandle := frmCLYouKa_Qty.Handle; end; 162: //驾驶员车辆信息查询 begin if frmCLYouJS_CX = nil then begin frmCLYouJS_CX := TfrmCLYouJS_CX.Create(application.MainForm); with frmCLYouJS_CX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouJS_CX.BringToFront; //句柄 mnewHandle := frmCLYouJS_CX.Handle; end; 26: //驾驶员工资发放登记 begin if frmCLManageJBC_JiuF = nil then begin frmCLManageJBC_JiuF := TfrmCLManageJBC_JiuF.Create(application.MainForm); with frmCLManageJBC_JiuF do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLManageJBC_JiuF.BringToFront; //句柄 mnewHandle := frmCLManageJBC_JiuF.Handle; end; 27: //砼报表年月日查询 begin if frmJGPBCKKCList_MRT = nil then begin frmJGPBCKKCList_MRT := TfrmJGPBCKKCList_MRT.Create(application.MainForm); with frmJGPBCKKCList_MRT do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGPBCKKCList_MRT.BringToFront; //句柄 mnewHandle := frmJGPBCKKCList_MRT.Handle; end; 28: //驾驶员工资年月查询 begin if frmJGPBCKKCList_JSYCXMgg = nil then begin frmJGPBCKKCList_JSYCXMgg := TfrmJGPBCKKCList_JSYCXMgg.Create(application.MainForm); with frmJGPBCKKCList_JSYCXMgg do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGPBCKKCList_JSYCXMgg.BringToFront; //句柄 mnewHandle := frmJGPBCKKCList_JSYCXMgg.Handle; end; 29: //油量考核登记 begin if frmCLYouKa_SHDJ = nil then begin frmCLYouKa_SHDJ := TfrmCLYouKa_SHDJ.Create(application.MainForm); with frmCLYouKa_SHDJ do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouKa_SHDJ.BringToFront; //句柄 mnewHandle := frmCLYouKa_SHDJ.Handle; end; 30: //大车驾驶员工资查询 begin if frmJGPBCKKCList_BengCheCXMgg = nil then begin frmJGPBCKKCList_BengCheCXMgg := TfrmJGPBCKKCList_BengCheCXMgg.Create(application.MainForm); with frmJGPBCKKCList_BengCheCXMgg do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGPBCKKCList_BengCheCXMgg.BringToFront; //句柄 mnewHandle := frmJGPBCKKCList_BengCheCXMgg.Handle; end; 31: //车载泵超方登记 begin if frmCLYouKa_CZGCF = nil then begin frmCLYouKa_CZGCF := TfrmCLYouKa_CZGCF.Create(application.MainForm); with frmCLYouKa_CZGCF do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouKa_CZGCF.BringToFront; //句柄 mnewHandle := frmCLYouKa_CZGCF.Handle; end; 32: //驾驶员工资明细汇总 begin if frmCLYouKa_GZMX = nil then begin frmCLYouKa_GZMX := TfrmCLYouKa_GZMX.Create(application.MainForm); with frmCLYouKa_GZMX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCLYouKa_GZMX.BringToFront; //句柄 mnewHandle := frmCLYouKa_GZMX.Handle; end; 17: //机物料采购申请登记 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料采购申请登记' then begin BringWindowToTop(frmCaiGouSQListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then begin frmCaiGouSQListJWL := TfrmCaiGouSQList.Create(application.MainForm); with frmCaiGouSQListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCaiGouSQListJWL.BringToFront; //句柄 mnewHandle := frmCaiGouSQListJWL.Handle; end; 18: //机物料采购申请登记(高权限) begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料采购申请登记(高权限)' then begin BringWindowToTop(frmCaiGouSQListJWLGQX.Handle); bFound := TRUE; Break; end; end; if not bFound then begin frmCaiGouSQListJWLGQX := TfrmCaiGouSQList.Create(application.MainForm); with frmCaiGouSQListJWLGQX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCaiGouSQListJWLGQX.BringToFront; //句柄 mnewHandle := frmCaiGouSQListJWLGQX.Handle; end; 19: //机物料采购申请审批 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料采购申请审批' then begin BringWindowToTop(frmCaiGouSQChkListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then //if frmCaiGouSQChkList=nil then begin frmCaiGouSQChkListJWL := TfrmCaiGouSQChkList.Create(application.MainForm); with frmCaiGouSQChkListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCaiGouSQChkListJWL.BringToFront; //句柄 mnewHandle := frmCaiGouSQChkListJWL.Handle; end; 20: //机物料采购申请查询 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料采购申请查询' then begin BringWindowToTop(frmCaiGouSQCXListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then //if frmCaiGouSQCXList=nil then begin frmCaiGouSQCXListJWL := TfrmCaiGouSQCXList.Create(application.MainForm); with frmCaiGouSQCXListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCaiGouSQCXListJWL.BringToFront; //句柄 mnewHandle := frmCaiGouSQCXListJWL.Handle; end; 21: //机物料入库管理 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料入库管理' then begin BringWindowToTop(frmJWLInChkListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then //if frmJWLInChkList=nil then begin frmJWLInChkListJWL := TfrmJWLInChkList.Create(application.MainForm); with frmJWLInChkListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLInChkListJWL.BringToFront; //句柄 mnewHandle := frmJWLInChkListJWL.Handle; end; 22: //机物料出库管理 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料出库管理' then begin BringWindowToTop(frmJWLOutChkListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then //if frmJWLOutChkList=nil then begin frmJWLOutChkListJWL := TfrmJWLOutChkList.Create(application.MainForm); with frmJWLOutChkListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLOutChkListJWL.BringToFront; //句柄 mnewHandle := frmJWLOutChkListJWL.Handle; end; 23: //机物料库存明细查询 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料库存查询' then begin BringWindowToTop(frmJWLKCListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then //if frmJWLKCList=nil then begin frmJWLKCListJWL := TfrmJWLKCList.Create(application.MainForm); with frmJWLKCListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLKCListJWL.BringToFront; //句柄 mnewHandle := frmJWLKCListJWL.Handle; end; 24: //机物料入库查询 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料入库查询' then begin BringWindowToTop(frmJWLInChkCXListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then // if frmJWLInChkCXList=nil then begin frmJWLInChkCXListJWL := TfrmJWLInChkCXList.Create(application.MainForm); with frmJWLInChkCXListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLInChkCXListJWL.BringToFront; //句柄 mnewHandle := frmJWLInChkCXListJWL.Handle; end; 25: //机物料出库查询 begin bFound := FALSE; for i := (App.MainForm.MDIChildCount - 1) downto 0 do begin if App.MainForm.MDIChildren[i].Caption = '机物料出库查询' then begin BringWindowToTop(frmJWLOutChkCXListJWL.Handle); bFound := TRUE; Break; end; end; if not bFound then //if frmJWLOutChkCXList=nil then begin frmJWLOutChkCXListJWL := TfrmJWLOutChkCXList.Create(application.MainForm); with frmJWLOutChkCXListJWL do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLOutChkCXListJWL.BringToFront; //句柄 mnewHandle := frmJWLOutChkCXListJWL.Handle; end; 251: //机物料库存年月查询 begin if frmJWLKCList_HZ = nil then begin frmJWLKCList_HZ := TfrmJWLKCList_HZ.Create(application.MainForm); with frmJWLKCList_HZ do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLKCList_HZ.BringToFront; //句柄 mnewHandle := frmJWLKCList_HZ.Handle; end; 40: //工地资料领取登记 begin if frmGDLLManage_Main = nil then begin frmGDLLManage_Main := TfrmGDLLManage_Main.Create(application.MainForm); with frmGDLLManage_Main do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmGDLLManage_Main.BringToFront; //句柄 mnewHandle := frmGDLLManage_Main.Handle; end; 41: //驾驶员工资各月份查询 begin if frmJGPBCKKCList_SJGZCX = nil then begin frmJGPBCKKCList_SJGZCX := TfrmJGPBCKKCList_SJGZCX.Create(application.MainForm); with frmJGPBCKKCList_SJGZCX do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJGPBCKKCList_SJGZCX.BringToFront; //句柄 mnewHandle := frmJGPBCKKCList_SJGZCX.Handle; end; 42: //泵车各类数据年份汇总查询 begin if frmBCHZ_Year = nil then begin frmBCHZ_Year := TfrmBCHZ_Year.Create(application.MainForm); with frmBCHZ_Year do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmBCHZ_Year.BringToFront; //句柄 mnewHandle := frmBCHZ_Year.Handle; end; 43: //驾驶员实发工资汇总查询 begin if frmBCHZ_Year_JSYSF = nil then begin frmBCHZ_Year_JSYSF := TfrmBCHZ_Year_JSYSF.Create(application.MainForm); with frmBCHZ_Year_JSYSF do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmBCHZ_Year_JSYSF.BringToFront; //句柄 mnewHandle := frmBCHZ_Year_JSYSF.Handle; end; 45: //搅拌车各类数据汇总查询 begin if frmJBCHZ_Year = nil then begin frmJBCHZ_Year := TfrmJBCHZ_Year.Create(application.MainForm); with frmJBCHZ_Year do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJBCHZ_Year.BringToFront; //句柄 mnewHandle := frmJBCHZ_Year.Handle; end; 47: //铲车各类数据汇总查询 begin if frmCCHZ_Year = nil then begin frmCCHZ_Year := TfrmCCHZ_Year.Create(application.MainForm); with frmCCHZ_Year do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmCCHZ_Year.BringToFront; //句柄 mnewHandle := frmCCHZ_Year.Handle; end; 46: //机物料费用汇总查询 begin if frmJWLKCList_MoneyHZ = nil then begin frmJWLKCList_MoneyHZ := TfrmJWLKCList_MoneyHZ.Create(application.MainForm); with frmJWLKCList_MoneyHZ do begin caption := Trim(Title); FormStyle := mstyle; windowState := mstate; BorderStyle := mborderstyle; //show; end; end else frmJWLKCList_MoneyHZ.BringToFront; //句柄 mnewHandle := frmJWLKCList_MoneyHZ.Handle; end; end; Result := mnewHandle; end; //=========================================================== //建立数据库连接池 //=========================================================== function ConnData(): Boolean; var IniFile: TIniFile; begin try IniFile := TIniFile.Create(ExtractFilePath(Application.ExeName) + 'SYSTEMSET.INI'); //PicSvr := IniFile.ReadString('SERVER', '服务器地址','127.0.0.1'); UserDataFlag := IniFile.ReadString('SERVER', '服务器地址类型', '-1'); finally IniFile.Free; end; if not Assigned(DataLink_TradeManage) then DataLink_TradeManage := TDataLink_TradeManage.Create(Application); try with DataLink_TradeManage.ADOLink do begin //if not Connected then begin Connected := false; ConnectionString := DConString; LoginPrompt := false; Connected := true; end; end; Result := true; except Result := false; application.MessageBox('数据库连接失败!', '错误', mb_Ok + MB_ICONERROR); end; end; initialization CoInitialize(nil); dxUnitsLoader.Initialize; finalization DataLink_TradeManage.Free; application := NewDllApp; dxUnitsLoader.Finalize; end.