新浦京81707con > 首页 > 小键盘练习程序delphi版,利用热键控制鼠标移动

原标题:小键盘练习程序delphi版,利用热键控制鼠标移动

浏览次数:153 时间:2019-11-13

procedure TForm1.FormDestroy(Sender: TObject);
begin
  btnUnsetHK.Click;
end;

procedure TForm1.GOClick(Sender: TObject);
begin

type
  TForm1 = class(TForm)
    Edit1: TEdit;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    Label1: TLabel;
    procedure FormShow(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
  *******
    { Private declarations }
  public
    { Public declarations }
  end;

procedure TForm1.OnHotKey(var Message: TWMHOTKEY);
var
  Point: TPoint;
  X, Y: Word;
begin
  GetCursorPos(Point); //取回当前坐标

procedure TForm1.FormShow(Sender: TObject);
begin
  //展现调整
  form1.TabControl1.TabIndex:=0;
  form1.Panel1.BringToFront;
  form1.Button1.Enabled:=false;
  WebBrowser1.Silent := True; //禁脚本错误

end.

const
  idHotKey : WORD = 0;

function GetHtml(const WebBrowser:TWebBrowser): string;
var
  Doc: IHTMLDocument2;
begin
  Doc := WebBrowser.Document as IHTMLDocument2;
  if Assigned(Doc) and Assigned(Doc.body) then
    Result := Doc.body.OuterHtml; //也足以用innerHTML拿到其HTML文本
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  I: Integer;
begin
  halt;

本程序的热键为小键盘的5,在编辑框内可以钦命坐标。

{$R *.dfm}
{$APPTYPE CONSOLE}
uses mshtml;

end;

  end;
end;

end.

图片 1

    SetCursorPos(X, Y);

分界面代码:

  end;
end;

  except
    ShowMessage(Error);

 

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,StrUtils;

procedure TForm1.btnExitClick(Sender: TObject);
begin
 
  Close;
end;

源代码下载:

function rndsum():integer;stdcall;
var
  i: Integer;
  sum1: Integer;
  str1: string;
  str2: string;
begin
  sum1:=14;

type
  TForm1 = class(TForm)
    btnSetHK: TButton;
    btnExit: TButton;
    GroupBox2: TGroupBox;
    Label3: TLabel;
    Label4: TLabel;
    btnUnsetHK: TButton;
    edYPos: TMaskEdit;
    edXPos: TMaskEdit;
    Memo: TMemo;
    procedure btnExitClick(Sender: TObject);
    procedure btnSetHKClick(Sender: TObject);
    procedure btnUnsetHKClick(Sender: TObject);
    procedure OnHotKey(var Message: TWMHOTKEY); message WM_HOTKEY;
    procedure FormDestroy(Sender: TObject);
  public
    { Public declarations }
  end;

天猫商城的宝贝描述页是ajax异步载入的,所以直接idhttp读一下是弄不到它的源码的。用上面包车型客车法子就足以。


end.

object Form1: TForm1
  Left = 229
  Top = 150
  BorderIcons = [biSystemMenu, biMinimize]
  Caption = #35835#28120#23453#21830#21697#25551#36848'  '#29482#24735#33021
  ClientHeight = 269
  ClientWidth = 330
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesigned
  OnShow = FormShow
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 8
    Top = 19
    Width = 23
    Height = 13
    Caption = 'URL:'
  end
  object Label2: TLabel
    Left = 15
    Top = 242
    Width = 156
    Height = 13
    Caption = #20808'go'#65292#31561#32593#39029#36733#20837#21518#20877#21462#28304#30721
    Color = clGradientActiveCaption
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clRed
    Font.Height = -11
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentColor = False
    ParentFont = False
  end
  object Edit1: TEdit
    Left = 32
    Top = 16
    Width = 241
    Height = 21
    TabOrder = 0
    Text =
      ''
      '999a205b3ed15545.jhtml'
  end
  object TabControl1: TTabControl
    Left = 8
    Top = 48
    Width = 313
    Height = 177
    TabOrder = 1
    Tabs.Strings = (
      'Html'
      'View')
    TabIndex = 0
    OnChange = TabControl1Change
    object Panel1: TPanel
      Left = 8
      Top = 24
      Width = 297
      Height = 145
      Caption = 'Panel1'
      TabOrder = 0
      object RichEdit1: TRichEdit
        Left = 0
        Top = 0
        Width = 297
        Height = 145
        Font.Charset = GB2312_CHARSET
        Font.Color = clWindowText
        Font.Height = -11
        Font.Name = 'Tahoma'
        Font.Style = []
        Lines.Strings = (
          'RichEdit1')
        ParentFont = False
        ScrollBars = ssVertical
        TabOrder = 0
      end
    end
    object Panel2: TPanel
      Left = 8
      Top = 24
      Width = 302
      Height = 150
      Caption = 'Panel2'
      TabOrder = 1
      object WebBrowser1: TWebBrowser
        Left = 0
        Top = 0
        Width = 297
        Height = 145
        TabOrder = 0
        ControlData = {
          4C000000B21E0000FC0E00000000000000000000000000000000000000000000
          000000004C000000000000000000000001000000E0D057007335CF11AE690800
          2B2E126208000000000000004C0000000114020000000000C000000000000046
          8000000000000000000000000000000000000000000000000000000000000000
          00000000000000000100000000000000000000000000000000000000}
      end
    end
  end
  object GO: TButton
    Left = 281
    Top = 21
    Width = 41
    Height = 21
    Caption = 'GO'
    TabOrder = 2
    OnClick = GOClick
  end
  object Button1: TButton
    Left = 192
    Top = 232
    Width = 57
    Height = 29
    Caption = #21462#28304#30721
    TabOrder = 3
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 265
    Top = 232
    Width = 57
    Height = 29
    Caption = #36864#20986
    TabOrder = 4
    OnClick = Button2Click
  end
end

procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
var
  c1: string;
  oldstr: string;
begin
  //只好输入数字
  if not (key in ['0'..'9',#8]) then
  begin
    key := #0;
    exit;
  end;

本文由新浦京81707con发布于首页,转载请注明出处:小键盘练习程序delphi版,利用热键控制鼠标移动

关键词: 新浦京81707con 开发 Delphi技术 开发手记 原创软件

上一篇:image控件闪屏

下一篇:没有了