ABでのスクリーンセーバー
Posted: 2005年10月10日(月) 19:13
ActiveBasicでスクリーンセーバーを作ろうと思います。
できればDirectXを使わずに作りたいのですが方法がわかりません。
何かよい方法はございませんでしょうか?
できればDirectXを使わずに作りたいのですが方法がわかりません。
何かよい方法はございませんでしょうか?
コード: 全て選択
TypeDef HIMC=HANDLE
Declare Function CreateMutex Lib "kernel32" Alias "CreateMutexA" (lpMutexAttributes As VoidPtr,bInitialOwner As Long,lpName As String) As Long
Declare Function ImmAssociateContext Lib "imm32"(hWnd As HWND,hIMC As HIMC) As HIMC
Dim hIMC As HIMC
Dim bMouseMoveFlag=0 As Long
Sub MainWnd_Create(ByRef CreateStruct As CREATESTRUCT)
CreateMutex(0,0,"AucMon")
If GetLastError()=183 Then ExitProcess(0)
/*ここに前処理を記述*/
ShowWindow(hMainWnd,SW_SHOWMAXIMIZED)
ShowCursor(0)
hIMC=ImmAssociateContext(hMainWnd,0)
End Sub
Sub MainWnd_MouseMove(flags As Long, x As Integer, y As Integer)
If bMouseMoveFlag Then DestroyWindow(hMainWnd) Else bMouseMoveFlag=1
End Sub
Sub MainWnd_KeyDown(KeyCode As Long, flags As Long)
DestroyWindow(hMainWnd)
End Sub
Sub MainWnd_Destroy()
ShowCursor(1)
ImmAssociateContext(hMainWnd,hIMC)
/*ここに後処理を記述*/
End Sub
コード: 全て選択
Dim BeforePos As POINTAPI
コード: 全て選択
GetCursorPos(BefPos)
コード: 全て選択
Sub MainWnd_MouseMove(flags As Long, x As Integer, y As Integer)
If BeforePos.x<>x or BeforePos.y<>y Then DestroyWindow(hMainWnd)
End Sub