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);
    
  • 相关阅读:
    hibernate映射-单向多对一映射
    CSS
    HTML基础
    复习
    元类,单例
    数据类型,约束,存储引擎
    数据库概念,安装,基本操作
    IO模型
    异步回调,协程
    GIL锁,线程池,同步异步
  • 原文地址:https://www.cnblogs.com/del/p/1070197.html
Copyright © 2011-2022 走看看