zoukankan      html  css  js  c++  java
  • WinAPI: LoadCursor 从资源中载入光标

    //声明:
    LoadCursor(
      hInstance: HINST;   {EXE 或 DLL 的句柄, 0 表示载入系统资源}
      lpCursorName: PChar {资源标识符}
    ): HCURSOR;           {返回光标句柄}
    
    这里有示例
    //调用系统光标的例子:
    
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, StdCtrls;
    
    type
      TForm1 = class(TForm)
        Button1: TButton;
        procedure Button1Click(Sender: TObject);
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
      cur: TIcon;
    begin
      cur := TIcon.Create;
    
      cur.Handle := LoadCursor(0, IDC_HAND);
      Canvas.Draw(11,11,cur);
      cur.Handle := LoadCursor(0, IDC_HELP);
      Canvas.Draw(44,11,cur);
    
      cur.Free;
    end;
    
    end.
    
    //效果图:

    //附系统光标列表:
    IDC_ARROW       = MakeIntResource(32512);
    IDC_IBEAM       = MakeIntResource(32513);
    IDC_WAIT        = MakeIntResource(32514);
    IDC_CROSS       = MakeIntResource(32515);
    IDC_UPARROW     = MakeIntResource(32516);
    IDC_SIZE        = MakeIntResource(32640);
    IDC_ICON        = MakeIntResource(32641);
    IDC_SIZENWSE    = MakeIntResource(32642);
    IDC_SIZENESW    = MakeIntResource(32643);
    IDC_SIZEWE      = MakeIntResource(32644);
    IDC_SIZENS      = MakeIntResource(32645);
    IDC_SIZEALL     = MakeIntResource(32646);
    IDC_NO          = MakeIntResource(32648);
    IDC_HAND        = MakeIntResource(32649);
    IDC_APPSTARTING = MakeIntResource(32650);
    IDC_HELP        = MakeIntResource(32651);
    
  • 相关阅读:
    微信扫码
    vue h5公众号支付
    vue h5支付宝支付
    vue PDF预览
    vue 中AES加密
    vue 动态路由配置
    移动端调试工具
    Ajax工作原理
    yahoo军规
    Flex 布局教程
  • 原文地址:https://www.cnblogs.com/del/p/1070197.html
Copyright © 2011-2022 走看看