请大家帮个生成ini文件的小忙,送分贴!!!(100)

  • 主题发起人 主题发起人 likingzhe
  • 开始时间 开始时间
L

likingzhe

Unregistered / Unconfirmed
GUEST, unregistred user!
这是一个无窗口的程序,请江湖老大帮帮忙,程序可以编译运行,你们没有驱动,可能会报错,这个不影响。我有这样一个需要要解决,程序是个2点的触摸程序,已实现。可它是个无窗口的程序,我无法把2个触摸坐标点的位置取出来或者传递出来。gp1,gp2,大侠们看程序就明白了。我现在想把这2个坐标点的值取出来,并把这2个点的坐标值传递给一个ini文件。例如,touchTwo.ini第一点x值=300第一点y值=400第二点x值=100第二点y值=600基本是这个意思,有可能不是xy值,可能是(长,宽,高,底)这样的四个值,看程序就明白了,请大侠们,帮我解决下,谢谢注意:把代码复制后另存为.dpr文件即可编译运行!program MultiTouSDK;uses Windows, Messages, SysUtils;type MTouchPoint = packed record x1: Integer; y1: Integer; x2: Integer; y2: Integer; end;type _TouchData = record dwTouchCount: DWORD; x1: DWORD; y1: DWORD; x2: DWORD; y2: DWORD; end; PointData = array[0..1] of _TouchData;const AppName = 'MultiTouSDK';var AppWnd: HWND; Msg: TMsg; WndClass: TWndClass; gBrBackground: HBRUSH; gCount: Integer = 0; gP1, gP2: MTouchPoint; function StartComDevice(nport: Integer; bTransform: Boolean): Integer; cdecl; external 'MultiTouchSDK.dll'; function RegistCallback(hMultTouchCallBack: PChar): Integer; cdecl; external 'MultiTouchSDK.dll'; function StopComDevice(): Integer; cdecl; external 'MultiTouchSDK.dll';function MultTouchCallBack(const pd: PointData; Cnt: Integer): Integer; stdcall; // 用 stdcall 定义回调函数var Rect: TRect; Scx, Scy: Integer;begin Scx := GetSystemMetrics(SM_CXSCREEN); Scy := GetSystemMetrics(SM_CYSCREEN); Rect.Left := 0; Rect.Top := 0; Rect.Right := Scx; Rect.Bottom := Scy; // 注:每个点都有两对坐标,即左上角和右下角坐标 if Cnt > 0 then // Cnt表示触摸的点数,1表示单点点触摸 begin gP1.x1 := pd[0].x1; // 单点触摸时该点的左上角x轴坐标 gP1.x2 := pd[0].x2; // 单点触摸时该点的右下角x轴坐标 gP1.y1 := pd[0].y1; // 单点触摸时该点的左上角y轴坐标 gP1.y2 := pd[0].y2; // 单点触摸时该点的右下角y轴坐标 if Cnt > 1 then begin gP2.x1 := pd[1].x1; // 两点触摸时第二点的左上角x轴坐标 gP2.x2 := pd[1].x2; // 两点触摸时第二点的右下角x轴坐标 gP2.y1 := pd[1].y1; // 两点触摸时第二点的左上角y轴坐标 gP2.y2 := pd[1].y2; // 两点触摸时第二点的右下角y轴坐标 end; end; gCount := Cnt; InvalidateRect(AppWnd, @Rect, False); UpdateWindow(AppWnd); end;function WndProc(Wnd: HWND; Msg, wParam: Word; lParam: LongInt): LongInt; stdcall;var Rect: TRect; Scx, Scy: Integer; DC: HDC; Ps: TPaintStruct; hBrushY, hBrushOld: HBRUSH;begin case Msg of WM_DESTROY: begin StopComDevice(); // 触摸屏停止 PostQuitMessage(0); end; WM_KEYUP: if wParam = VK_ESCAPE then // 按下 ESC 键 PostQuitMessage(0); WM_COMMAND: if LOWORD(wParam) = WM_CLOSE then DestroyWindow(Wnd); WM_PAINT: begin DC := BeginPaint(Wnd, Ps); Scx := GetSystemMetrics(SM_CXSCREEN); Scy := GetSystemMetrics(SM_CYSCREEN); Rect.Left := 0; Rect.Top := 0; Rect.Right := Scx; Rect.Bottom := Scy; FillRect(DC, Rect, gBrBackground); SetTextColor(DC, RGB(255, 128, 64)); SetBkMode(DC, TRANSPARENT); TextOut(DC, Round(Rect.Right / 2 - 100), 20, 'Please press ESC key to cancel.', 31); hBrushY := CreateSolidBrush(RGB(255, 128, 64)); hBrushOld := HBRUSH(SelectObject(DC, hBrushY)); if gCount > 0 then begin Rect.Left := Round(gP1.x1 * Scx / 4096); Rect.Right := Round(gP1.x2 * Scx / 4096); Rect.Top := Round(gP1.y1 * Scy / 4096); Rect.Bottom := Round(gP1.y2 * Scy / 4096); Ellipse(DC, Rect.Left - 5, Rect.Top - 5, Rect.Right, Rect.Bottom); if gCount > 1 then begin Rect.Left := Round(gP2.x1 * Scx / 4096); Rect.Right := Round(gP2.x2 * Scx / 4096); Rect.Top := Round(gP2.y1 * Scy / 4096); Rect.Bottom := Round(gP2.y2 * Scy / 4096); Ellipse(DC, Rect.Left - 5, Rect.Top - 5, Rect.Right, Rect.Bottom); end; DeleteObject(hBrushY); DeleteObject(hBrushOld); end; EndPaint(Wnd, Ps); end; end; WndProc := DefWindowProc(Wnd, Msg, wParam, lParam);end; begin if FindWindow(AppName, nil) <> 0 then Halt; FillChar(WndClass, SizeOf(WndClass), 0); with WndClass do begin style := CS_HREDRAW or CS_VREDRAW; lpfnWndProc := @WndProc; // 取回调函数 WndProc 的地址 hInstance := SysInit.HInstance; // 实例句柄 hIcon := LoadIcon(hInstance, 'MAINICON'); hCursor := LoadCursor(hInstance, IDC_ARROW); lpszClassName := AppName; // 窗口类名 end; RegisterClass(WndClass); // 注册窗口类 gBrBackground := CreateSolidBrush(RGB(0, 128, 255)); AppWnd := CreateWindow(AppName, nil, WS_POPUP or WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), 0, 0, HInstance, nil); if AppWnd > 0 then begin ShowWindow(AppWnd, SW_NORMAL); UpdateWindow(AppWnd); RegistCallback(@MultTouchCallBack); // 注册回调函数 StartComDevice(0, True); // 启动 COM 口的触摸屏 end; while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); end;end.
 
?这个很难嘛,分数可以加倍,大家尽量帮忙
 
实时在function WndProc(Wnd: HWND; Msg, wParam: Word; lParam: LongInt): LongInt; stdcall;回调函数中写入Ini文件不行吗?
 
007vivi,好,我试试,谢谢提醒
 
搞不定,那位大侠有时间和精力的话,帮我写写。求助!!!
 
哈哈,你上个贴还没结给我呢,先结了吧。http://www.delphibbs.com/delphibbs/dispq.asp?lid=3996133
 
哈哈,你上个贴还没结呢,先结了吧。[:D]
 
szhcracker老大,您还真可以?您要分,就开口,我有多少就给您多少。我不在乎这个,我只要答案,可您老回答一半,我也难受。上个贴,您看了,之前分数都给过您了。然后需要2个点的坐标的提取或传递,这您非常清楚,说的很明白了。您并没有给出办法!您要我结那个贴,我给您就是了。做事做的认真,办事才有效率
 
szhcracker老大,那个贴给您了。希望这次您能帮我把问题彻底解决。事情搞定后,我该谢你谢你,该请你请你,我心里有说。说了请您吃鸭子,您就是在美国,我也把鸭子给您空邮过去,我说话算数。我就要这个2个鼠标点的坐标,把它们传递给一个ini文件里,说明帖子很详细了,你看看吧。那位大侠回答了,我同样感谢。北京烤鸭一只,在北京的直接请吃,不在北京的,空邮过去!
 
实在是被LZ打到了,看来LZ是一实在人,我为何喜欢分数是因为我想排进前100名,现在看来目标还很远,所以对分数比较计较,至于你的问题我会再看看。
 
inifile读写例子http://cactusprogram.appspot.com/?p=1002
 
我改了一下代码,你试试。program MultiTouSDK;uses Windows, Messages, SysUtils, Classes;type MTouchPoint = packed record x1: Integer; y1: Integer; x2: Integer; y2: Integer; end;type _TouchData = record dwTouchCount: DWORD; x1: DWORD; y1: DWORD; x2: DWORD; y2: DWORD; end; PointData = array[0..1] of _TouchData;const AppName = 'MultiTouSDK';var AppWnd: HWND; Msg: TMsg; WndClass: TWndClass; gBrBackground: HBRUSH; gCount: Integer = 0; gP1, gP2: MTouchPoint; RstList: TStrings; function StartComDevice(nport: Integer; bTransform: Boolean): Integer; cdecl; external 'MultiTouchSDK.dll'; function RegistCallback(hMultTouchCallBack: PChar): Integer; cdecl; external 'MultiTouchSDK.dll'; function StopComDevice(): Integer; cdecl; external 'MultiTouchSDK.dll';procedure SaveToStrings(Cont: Integer; mTP: MTouchPoint);const C: array[1..2] of string = ('单点', '两点');begin RstList.Add(C[Cont] + '触摸时该点的左上角x轴坐标=' + IntToStr(mTP.x1)); RstList.Add(C[Cont] + '触摸时该点的右下角x轴坐标=' + IntToStr(mTP.x2)); RstList.Add(C[Cont] + '触摸时该点的左上角y轴坐标=' + IntToStr(mTP.y1)); RstList.Add(C[Cont] + '触摸时该点的右下角y轴坐标=' + IntToStr(mTP.y2));end;function MultTouchCallBack(const pd: PointData; Cnt: Integer): Integer; stdcall; // 用 stdcall 定义回调函数var Rect: TRect; Scx, Scy: Integer;begin Scx := GetSystemMetrics(SM_CXSCREEN); Scy := GetSystemMetrics(SM_CYSCREEN); Rect.Left := 0; Rect.Top := 0; Rect.Right := Scx; Rect.Bottom := Scy; // 注:每个点都有两对坐标,即左上角和右下角坐标 if Cnt > 0 then // Cnt表示触摸的点数,1表示单点点触摸 begin gP1.x1 := pd[0].x1; // 单点触摸时该点的左上角x轴坐标 gP1.x2 := pd[0].x2; // 单点触摸时该点的右下角x轴坐标 gP1.y1 := pd[0].y1; // 单点触摸时该点的左上角y轴坐标 gP1.y2 := pd[0].y2; // 单点触摸时该点的右下角y轴坐标 SaveToStrings(Cnt, gP1); if Cnt > 1 then begin gP2.x1 := pd[1].x1; // 两点触摸时第二点的左上角x轴坐标 gP2.x2 := pd[1].x2; // 两点触摸时第二点的右下角x轴坐标 gP2.y1 := pd[1].y1; // 两点触摸时第二点的左上角y轴坐标 gP2.y2 := pd[1].y2; // 两点触摸时第二点的右下角y轴坐标 SaveToStrings(Cnt, gP2); end; end; gCount := Cnt; InvalidateRect(AppWnd, @Rect, False); UpdateWindow(AppWnd); end;function WndProc(Wnd: HWND; Msg, wParam: Word; lParam: LongInt): LongInt; stdcall;var Rect: TRect; Scx, Scy: Integer; DC: HDC; Ps: TPaintStruct; hBrushY, hBrushOld: HBRUSH;begin case Msg of WM_DESTROY: begin if RstList.Count > 0 then RstList.SaveToFile('C:/MultiTouSDK.txt'); StopComDevice(); // 触摸屏停止 FreeAndNil(RstList); PostQuitMessage(0); end; WM_KEYUP: if wParam = VK_ESCAPE then // 按下 ESC 键 PostQuitMessage(0); WM_COMMAND: if LOWORD(wParam) = WM_CLOSE then DestroyWindow(Wnd); WM_PAINT: begin DC := BeginPaint(Wnd, Ps); Scx := GetSystemMetrics(SM_CXSCREEN); Scy := GetSystemMetrics(SM_CYSCREEN); Rect.Left := 0; Rect.Top := 0; Rect.Right := Scx; Rect.Bottom := Scy; FillRect(DC, Rect, gBrBackground); SetTextColor(DC, RGB(255, 128, 64)); SetBkMode(DC, TRANSPARENT); TextOut(DC, Round(Rect.Right / 2 - 100), 20, 'Please press ESC key to cancel.', 31); hBrushY := CreateSolidBrush(RGB(255, 128, 64)); hBrushOld := HBRUSH(SelectObject(DC, hBrushY)); if gCount > 0 then begin Rect.Left := Round(gP1.x1 * Scx / 4096); Rect.Right := Round(gP1.x2 * Scx / 4096); Rect.Top := Round(gP1.y1 * Scy / 4096); Rect.Bottom := Round(gP1.y2 * Scy / 4096); Ellipse(DC, Rect.Left - 5, Rect.Top - 5, Rect.Right, Rect.Bottom); // 如果回调函数中无法取得坐标值则可以在此处加上 SaveToStrings 方法的调用一试 // 如成功则去掉回调函数 MultTouchCallBack 中的 SaveToStrings 方法的调用 // SaveToStrings(gCount, gP1); if gCount > 1 then begin Rect.Left := Round(gP2.x1 * Scx / 4096); Rect.Right := Round(gP2.x2 * Scx / 4096); Rect.Top := Round(gP2.y1 * Scy / 4096); Rect.Bottom := Round(gP2.y2 * Scy / 4096); Ellipse(DC, Rect.Left - 5, Rect.Top - 5, Rect.Right, Rect.Bottom); // 如果回调函数中无法取得坐标值则可以在此处加上 SaveToStrings 方法的调用一试 // 如成功则去掉回调函数 MultTouchCallBack 中的 SaveToStrings 方法的调用 // SaveToStrings(gCount, gP2); end; DeleteObject(hBrushY); DeleteObject(hBrushOld); end; EndPaint(Wnd, Ps); end; end; WndProc := DefWindowProc(Wnd, Msg, wParam, lParam);end; begin if FindWindow(AppName, nil) <> 0 then Halt; FillChar(WndClass, SizeOf(WndClass), 0); with WndClass do begin style := CS_HREDRAW or CS_VREDRAW; lpfnWndProc := @WndProc; // 取回调函数 WndProc 的地址 hInstance := SysInit.HInstance; // 实例句柄 hIcon := LoadIcon(hInstance, 'MAINICON'); hCursor := LoadCursor(0, IDC_ARROW); lpszClassName := AppName; // 窗口类名 end; Windows.RegisterClass(WndClass); // 注册窗口类 gBrBackground := CreateSolidBrush(RGB(0, 128, 255)); AppWnd := CreateWindow(AppName, nil, WS_POPUP or WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), 0, 0, HInstance, nil); if AppWnd > 0 then begin ShowWindow(AppWnd, SW_NORMAL); UpdateWindow(AppWnd); RstList := TStringList.Create; RegistCallback(@MultTouchCallBack); // 注册回调函数 StartComDevice(0, True); // 启动 COM 口的触摸屏 end; while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); end;end.
 
呵呵,我看看,谢谢szhcracker老大,还有cactus123456 老大,还有关注这个问题大所有朋友。
 
估计还是要放到 WM_PAINT 里
 
szhcracker老大,该怎么操作才能生产'C:/MultiTouSDK.txt'文件。我没有生成出来
 
对 WM_KEYUP 消息的处理改为以下代码试试:WM_KEYUP: if wParam = VK_ESCAPE then // 按下 ESC 键 begin if RstList.Count > 0 then RstList.SaveToFile('C:/MultiTouSDK.txt'); StopComDevice(); // 触摸屏停止 FreeAndNil(RstList); PostQuitMessage(0); end;
 
szhcracker,老大,我搞明白了。不过,效果的实现和我的预想还差了点。帮我看看怎么解决!1,我要的是时时能生产坐标点的,而不是在我结束程序的时候生产文件。(最好是时时生产ini文件,这样我能更好的用其他程序衔接。)2,呵呵,不需要显示那么多数据的。只要显示x1,x2,y1,y2就好了。不是特关心它们的历史轨迹,呵呵。文件:x1的坐标=100x2的坐标=200y1的坐标=300ye的坐标=400这样就好了,时时的替换这四行文件就好了,要是ini文件,就是替换‘=’号后面的数字了。已经非常感谢szhcracker老大了,这个问题解决完了,我给您双倍的分数,我自己也看看,有了这个思路,呵呵,我也动动脑子。
 
呵呵,我搞定了,szhcracker老大,帮我看看,对不
 
program MultiTouSDK;uses Windows, Messages, SysUtils, Classes, IniFiles, Controls, Dialogs, Forms;type MTouchPoint = packed record x1: Integer; y1: Integer; x2: Integer; y2: Integer; end;type _TouchData = record dwTouchCount: DWORD; x1: DWORD; y1: DWORD; x2: DWORD; y2: DWORD; end; PointData = array[0..1] of _TouchData;const AppName = 'MultiTouSDK';var AppWnd: HWND; Msg: TMsg; WndClass: TWndClass; gBrBackground: HBRUSH; gCount: Integer = 0; gP1, gP2: MTouchPoint; RstList: TStrings; strX1,strX2,strY1,strY2: string; function StartComDevice(nport: Integer; bTransform: Boolean): Integer; cdecl; external 'MultiTouchSDK.dll'; function RegistCallback(hMultTouchCallBack: PChar): Integer; cdecl; external 'MultiTouchSDK.dll'; function StopComDevice(): Integer; cdecl; external 'MultiTouchSDK.dll';procedure SaveToStrings(Cont: Integer; mTP: MTouchPoint);const C: array[1..2] of string = ('单点', '两点');begin //RstList.Add(C[Cont] + '触摸时该点的左上角x1轴坐标=' + IntToStr(mTP.x1)); //RstList.Add(C[Cont] + '触摸时该点的右下角x2轴坐标=' + IntToStr(mTP.x2)); //RstList.Add(C[Cont] + '触摸时该点的左上角y1轴坐标=' + IntToStr(mTP.y1)); //RstList.Add(C[Cont] + '触摸时该点的右下角y2轴坐标=' + IntToStr(mTP.y2)); strX1:=IntToStr(mTP.x1); strY1:=IntToStr(mTP.y1); strX2:=IntToStr(mTP.x2); strY2:=IntToStr(mTP.y2);end;procedure SaveCurrentSettings;var IniFile: TIniFile; FileName: String; SettingStr: String; Number: Integer;begin FileName:=ExtractFilePath(Application.ExeName)+'ZmRy.ini'; IniFile:=TInifile.Create(FileName); SettingStr:='Settings1'; Number:=1; try With IniFile do begin WriteString('Settings1','第一点x1',strX1); WriteString('Settings1','第一点y1',strY1); WriteString('Settings1','第一点x2',strX2); WriteString('Settings1','第一点y2',strY2); end; finally IniFile.Free; end;end;function MultTouchCallBack(const pd: PointData; Cnt: Integer): Integer; stdcall; // 用 stdcall 定义回调函数var Rect: TRect; Scx, Scy: Integer;begin Scx := GetSystemMetrics(SM_CXSCREEN); Scy := GetSystemMetrics(SM_CYSCREEN); Rect.Left := 0; Rect.Top := 0; Rect.Right := Scx; Rect.Bottom := Scy; // 注:每个点都有两对坐标,即左上角和右下角坐标 if Cnt > 0 then // Cnt表示触摸的点数,1表示单点点触摸 begin gP1.x1 := pd[0].x1; // 单点触摸时该点的左上角x轴坐标 gP1.x2 := pd[0].x2; // 单点触摸时该点的右下角x轴坐标 gP1.y1 := pd[0].y1; // 单点触摸时该点的左上角y轴坐标 gP1.y2 := pd[0].y2; // 单点触摸时该点的右下角y轴坐标 SaveToStrings(Cnt, gP1); if Cnt > 1 then begin gP2.x1 := pd[1].x1; // 两点触摸时第二点的左上角x轴坐标 gP2.x2 := pd[1].x2; // 两点触摸时第二点的右下角x轴坐标 gP2.y1 := pd[1].y1; // 两点触摸时第二点的左上角y轴坐标 gP2.y2 := pd[1].y2; // 两点触摸时第二点的右下角y轴坐标 SaveToStrings(Cnt, gP2); end; end; gCount := Cnt; InvalidateRect(AppWnd, @Rect, False); UpdateWindow(AppWnd); end;function WndProc(Wnd: HWND; Msg, wParam: Word; lParam: LongInt): LongInt; stdcall;var Rect: TRect; Scx, Scy: Integer; DC: HDC; Ps: TPaintStruct; hBrushY, hBrushOld: HBRUSH;begin case Msg of WM_DESTROY: begin if RstList.Count > 0 then RstList.SaveToFile('C:/MultiTouSDK.txt'); StopComDevice(); // 触摸屏停止 FreeAndNil(RstList); PostQuitMessage(0); end; WM_KEYUP: {if wParam = VK_ESCAPE then // 按下 ESC 键 begin if RstList.Count > 0 then RstList.SaveToFile('C:/MultiTouSDK.txt'); StopComDevice(); // 触摸屏停止 FreeAndNil(RstList); PostQuitMessage(0); end; } // SaveCurrentSettings; WM_COMMAND: if LOWORD(wParam) = WM_CLOSE then DestroyWindow(Wnd); WM_PAINT: begin DC := BeginPaint(Wnd, Ps); Scx := GetSystemMetrics(SM_CXSCREEN); Scy := GetSystemMetrics(SM_CYSCREEN); Rect.Left := 0; Rect.Top := 0; Rect.Right := Scx; Rect.Bottom := Scy; FillRect(DC, Rect, gBrBackground); SetTextColor(DC, RGB(255, 128, 64)); SetBkMode(DC, TRANSPARENT); TextOut(DC, Round(Rect.Right / 2 - 100), 20, 'Please press ESC key to cancel.', 31); hBrushY := CreateSolidBrush(RGB(255, 128, 64)); hBrushOld := HBRUSH(SelectObject(DC, hBrushY)); if gCount > 0 then begin Rect.Left := Round(gP1.x1 * Scx / 4096); Rect.Right := Round(gP1.x2 * Scx / 4096); Rect.Top := Round(gP1.y1 * Scy / 4096); Rect.Bottom := Round(gP1.y2 * Scy / 4096); Ellipse(DC, Rect.Left - 5, Rect.Top - 5, Rect.Right, Rect.Bottom); // 如果回调函数中无法取得坐标值则可以在此处加上 SaveToStrings 方法的调用一试 // 如成功则去掉回调函数 MultTouchCallBack 中的 SaveToStrings 方法的调用 // SaveToStrings(gCount, gP1); if gCount > 1 then begin Rect.Left := Round(gP2.x1 * Scx / 4096); Rect.Right := Round(gP2.x2 * Scx / 4096); Rect.Top := Round(gP2.y1 * Scy / 4096); Rect.Bottom := Round(gP2.y2 * Scy / 4096); Ellipse(DC, Rect.Left - 5, Rect.Top - 5, Rect.Right, Rect.Bottom); // 如果回调函数中无法取得坐标值则可以在此处加上 SaveToStrings 方法的调用一试 // 如成功则去掉回调函数 MultTouchCallBack 中的 SaveToStrings 方法的调用 // SaveToStrings(gCount, gP2); end; DeleteObject(hBrushY); DeleteObject(hBrushOld); end; EndPaint(Wnd, Ps); end; end; WndProc := DefWindowProc(Wnd, Msg, wParam, lParam);end; begin if FindWindow(AppName, nil) <> 0 then Halt; FillChar(WndClass, SizeOf(WndClass), 0); with WndClass do begin style := CS_HREDRAW or CS_VREDRAW; lpfnWndProc := @WndProc; // 取回调函数 WndProc 的地址 hInstance := SysInit.HInstance; // 实例句柄 hIcon := LoadIcon(hInstance, 'MAINICON'); hCursor := LoadCursor(0, IDC_ARROW); lpszClassName := AppName; // 窗口类名 end; Windows.RegisterClass(WndClass); // 注册窗口类 gBrBackground := CreateSolidBrush(RGB(0, 128, 255)); AppWnd := CreateWindow(AppName, nil, WS_POPUP or WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), 0, 0, HInstance, nil); if AppWnd > 0 then begin ShowWindow(AppWnd, SW_NORMAL); UpdateWindow(AppWnd); RstList := TStringList.Create; RegistCallback(@MultTouchCallBack); // 注册回调函数 StartComDevice(0, True); // 启动 COM 口的触摸屏 end; while GetMessage(Msg, 0, 0, 0) do begin TranslateMessage(Msg); DispatchMessage(Msg); end;end.
 
你的代码呢?
 
后退
顶部