WINDOWS |
尚未結案
|
TUN
一般會員 發表:1 回覆:3 積分:0 註冊:2016-09-05 發送簡訊給我 |
各位前輩
用了一個以前的例子想監視系統內的運轉訊息(網路DOWNLOAD的). 用XE10好像不能RUN, 一COMPILE就有ERROR. 能否請前輩幫忙? 例子如下 unit WinProc1; interface uses {$IFDEF WIN32} WINAPI.Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Grids, DBGrids, DB, DBTables; {$ELSE} SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls, Forms, Dialogs, DB, DBTables, Grids, DBGrids; {$ENDIF} type TForm1 = class(TForm) DBGrid1: TDBGrid; Table1: TTable; DataSource1: TDataSource; //DBGrid1: TDBGrid; // Table1: TTable; // DataSource1: TDataSource; procedure FormCreate(Sender: TObject); procedure FormDestroy(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} type {$IFDEF WIN32} WParameter = LongInt; {$ELSE} WParameter = Word; {$ENDIF} LParameter = LongInt; {Declare a variable to hold the window procedure we are replacing} var OldWindowProc : Pointer; function NewWindowProc(WindowHandle : hWnd; TheMessage : WParameter; ParamW : WParameter; ParamL : LParameter) : LongInt {$IFDEF WIN32} stdcall; {$ELSE} ; export; {$ENDIF} begin { Process the message of your choice here } if TheMessage = WM_VSCROLL then begin ShowMessage('The vertical scrollbar is scrolling!'); end; { Exit here and return zero if you want } { to stop further processing of the message } { Call the old Window procedure to } { allow processing of the message. } NewWindowProc := CallWindowProc(OldWindowProc, WindowHandle, TheMessage, ParamW, ParamL); end; procedure TForm1.FormCreate(Sender: TObject); begin { Set the new window procedure for the control } { and remember the old window procedure. } OldWindowProc := Pointer(SetWindowLong(DbGrid1.Handle, GWL_WNDPROC, LongInt(NewWindowProc))); end; procedure TForm1.FormDestroy(Sender: TObject); begin { Set the window procedure back } { to the old window procedure. } SetWindowLong(DbGrid1.Handle, GWL_WNDPROC, LongInt(OldWindowProc)); end; end. (* { The program's main source file } program WinProc; uses Forms, WinProc1 in 'WinProc1.pas' {Form1}; {$R *.RES} begin {$IFDEF WIN32} Application.Initialize; {$ENDIF} Application.CreateForm(TForm1, Form1); Application.Run; end. *) { end of ti }
------
jian chien |
aftcast
站務副站長 發表:81 回覆:1485 積分:1763 註冊:2002-11-21 發送簡訊給我 |
|
TUN
一般會員 發表:1 回覆:3 積分:0 註冊:2016-09-05 發送簡訊給我 |
procedure TForm1.FormCreate(Sender: TObject);
begin { Set the new window procedure for the control } { and remember the old window procedure. } OldWindowProc := Pointer(SetWindowLong(DbGrid1.Handle, GWL_WNDPROC, 主要是這裡沒法COMPILER end; //[dcc32 Error] WinProc1.PAS(80): E2035 Not enough actual parameters.
------
jian chien |
P.D.
版主 發表:603 回覆:4038 積分:3874 註冊:2006-10-31 發送簡訊給我 |
|
TUN
一般會員 發表:1 回覆:3 積分:0 註冊:2016-09-05 發送簡訊給我 |
|
pcplayer99
尊榮會員 發表:146 回覆:790 積分:632 註冊:2003-01-21 發送簡訊給我 |
|
TUN
一般會員 發表:1 回覆:3 積分:0 註冊:2016-09-05 發送簡訊給我 |
|
stacker_liew
中階會員 發表:59 回覆:168 積分:65 註冊:2004-05-17 發送簡訊給我 |
|
Ktop_Robot
站務副站長 發表:0 回覆:3511 積分:0 註冊:2007-04-17 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |