文書番号: 401688
最終更新日: 1998/02/03
'API の Declare 宣言 Private Declare Function LoadCursor Lib "USER" (ByVal hInstance As _ Integer, ByVal lpCursorName As Any) As Integer Private Declare Function DestroyCursor Lib "USER" (ByVal hCursor As _ Integer) As Integer Private Declare Function SetCursor Lib "USER" (ByVal hCursor As _ Integer) As Integer '標準で用意されているマウスカーソルの定数の定義 (それぞれの形状については、 '実際に試してご確認ください) Private Const IDC_ARROW = 32512& Private Const IDC_IBEAM = 32513& Private Const IDC_WAIT = 32514& Private Const IDC_CROSS = 32515& Private Const IDC_UPARROW = 32516& Private Const IDC_SIZE = 32640& Private Const IDC_ICON = 32641& Private Const IDC_SIZENWSE = 32642& Private Const IDC_SIZENESW = 32643& Private Const IDC_SIZEWE = 32644& Private Const IDC_SIZENS = 32645& Sub SetWait(fSetWaitCursor As Boolean) Static oldcursor%, fWaitCursorSet As Boolean If fSetWaitCursor Then '指定カーソルの読み込み及び設定 oldcursor% = SetCursor(LoadCursor(0, IDC_WAIT)) fWaitCursorSet = True ElseIf Not fSetWaitCursor And fWaitCursorSet Then '元のカーソルに復元 SetCursor oldcursor% fWaitCursorSet = False End If End Sub
Sub CursorChangeTest() Dim i As Double Dim a As String 'カーソルの設定 SetWait True 'ループ処理 For i = 1 To 50000 Step 1 a = "a" Next i 'カーソルの再設定 SetWait False End Sub
Keywords: KBHOWTO KB401688
Technology: kbExcel500 kbExcelSearch kbExcelWinSearch