我想监视剪帖板。但不知道为什么,有问题,总是说句柄无效。
下面是我的代码。就是调用SetClipboardViewer,我看别人也是这么写。
但我的代码就是不行,不知道问题出在哪
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Clipbrd;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var
NextViewHandle :THandle;
begin
NextViewHandle := SetClipboardViewer(Handle);
ShowMessage(SysErrorMessage(GetLastError));
end;
end.
下面是我的代码。就是调用SetClipboardViewer,我看别人也是这么写。
但我的代码就是不行,不知道问题出在哪
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Clipbrd;
type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
private
public
end;
var
Form1: TForm1;
implementation
{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var
NextViewHandle :THandle;
begin
NextViewHandle := SetClipboardViewer(Handle);
ShowMessage(SysErrorMessage(GetLastError));
end;
end.
解决方案 »
- override和overload(希望对大家有帮助。重发自2003年的帖。)
- 请问如何获得文件的创建时间,修改时间以及创建作者等信息
- 用READLN读一个文件 怎样才知道已经读完了呢?
- 菜鸟问题,请求帮助
- 关于解决滚动占用资源100%问题
- 急急急急急急急急急急急急急急急急 :用QRMemo打印分不了页????????????,,,帮手!
- 怎样用delphi在dbf中创建一个浮点型的字段,长度为12,小数位为2!(着急啊)
- createwindow 创建一个窗口(它的许多参数实在难搞懂),请附实例。我找遍dfw和csdn也没搞明白,它就这么难吗?靠!
- 关于tcp/ip编程的问题。
- 如何用Panel代替佛Form的标题条?
- 小小空值问题!!在adoquery中怎么使用EDIT做为参数值????
- 考过dephi6认证的进来!
没错的。只要一个参数就是HandleSyntaxHWND SetClipboardViewer(HWND hWndNewViewer);Parameters
hWndNewViewer[in] Handle to the window to be added to the clipboard chain. Return ValueIf the function succeeds, the return value identifies the next window in the clipboard viewer chain. If an error occurs or there are no other windows in the clipboard viewer chain, the return value is NULL. To get extended error information, call GetLastError.