コントロール上のカーソルを変更 <TOP>
例では、Button上のカーソルを変更しています。
LoadCursorFromFile カーソルをファイルから取得
SetClassLong クラスに関連づけされている補足領域にlong値を設定

'================================================================ '= コントロール上のカーソルを変更
'= (SetClassLong2.bas) '================================================================ #include "Windows.bi" ' カーソルをファイルから取得 Declare Function Api_LoadCursorFromFile& Lib "user32" Alias "LoadCursorFromFileA" (ByVal lpFileName$) ' クラスに関連付けている補足データ域にlong値を設定 Declare Function Api_SetClassLong& Lib "user32" Alias "SetClassLongA" (ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&) #define GCW_HCURSOR (-12) '初期値のカーソルハンド Var Shared Button1 As Object
Button1.Attach GetDlgItem("Button1")
'================================================================
'=
'================================================================
Declare Sub MainForm_Start edecl ()
Sub MainForm_Start()
    Var hWnd As Long
    Var Ret As Long
    'ファイルからカーソルを読み込む
    hWnd = Api_LoadCursorFromFile("C:\Windows\Cursors\dinosau2.ani")
    'Button上のカーソル
    Ret = Api_SetClassLong(Button1.GethWnd, GCW_HCURSOR, hWnd)
End Sub
'================================================================
'=
'================================================================
While 1
    WaitEvent
Wend
Stop
End