コード: 全て選択
Dim mouse As POINTAPI
Dim Desk As RECT
Dim hMainWnd As HWND
Dim Start As RECT
Dim hFont_MainWnd As HFONT
Dim h3DFaceBrush As HBRUSH
Dim _RadSys_wcl As WNDCLASSEX
Dim WndThread As Long
GetWindowRect(GetDesktopWindow(),Desk)
Start.left=0
Start.top=Desk.bottom-600
Start.bottom=Desk.bottom-31-Start.top
Start.right=400
If Start.top<0 then Start.top=0
If Start.right>Desk.right then Start.right=Desk.right
hFont_MainWnd=CreateFont(-12,0,0,0,400,0,0,0,128,3,2,1,32,"fixedSys")
h3DFaceBrush=CreateSolidBrush(&HFFFFFF)
FillMemory(VarPtr(_RadSys_wcl),Len(_RadSys_wcl),0)
_RadSys_wcl.cbSize=Len(_RadSys_wcl)
_RadSys_wcl.hInstance=GetModuleHandle(0)
_RadSys_wcl.style=CS_HREDRAW or CS_VREDRAW or CS_DBLCLKS
_RadSys_wcl.hCursor=LoadCursor(NULL,MAKEINTRESOURCE(IDC_ARROW))
_RadSys_wcl.hIcon=LoadIcon(NULL,MAKEINTRESOURCE(IDI_APPLICATION))
_RadSys_wcl.hIconSm=LoadIcon(NULL,MAKEINTRESOURCE(IDI_WINLOGO))
_RadSys_wcl.lpszClassName="NORMAL0"
_RadSys_wcl.lpfnWndProc=AddressOf(MainWndProc)
_RadSys_wcl.hbrBackground=h3DFaceBrush
RegisterClassEx(_RadSys_wcl)
CreateWindowEx(WS_EX_TOOLWINDOW,"NORMAL0","test",&H10cf0000,Start.left,Start.top,Start.right,Start.bottom,0,0,GetModuleHandle(0),0)
ShowWindow(hMainWnd,SW_HIDE)
Dim A As DWord,B As DWordPtr
B=VarPtr(A)
WndThread=0
CreateThread(ByVal 0,0,AddressOf(SeeMainWnd),0,0,B)
CloseHandle(B)
Dim msgMain As MSG, iResult As Long
Do
iResult=GetMessage(msgMain,0,0,0)
If iResult=0 or iResult=-1 Then Exit Do
TranslateMessage(msgMain)
DispatchMessage(msgMain)
Loop
End
Function DefaultCallProc(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
DefaultCallProc=DefWindowProc(hWnd,message,wParam,lParam)
End Function
Function EventCall_MainWnd(hWnd As HWND, message As DWord, wParam As WPARAM, lParam As LPARAM) As LRESULT
Select Case message
Case WM_DESTROY
MainWnd_Destroy()
Case WM_CREATE
hMainWnd=hWnd
Case WM_MOVE
ShowWindow(hMainWnd,SW_SHOWNOACTIVATE)
Case WM_CLOSE
Dim cancel=0 As Integer
If cancel=0 Then DestroyWindow(hWnd)
Case WM_MOVE
MainWnd_Move(LOWORD(lParam),HIWORD(lParam))
Case Else
EventCall_MainWnd=DefWindowProc(hWnd,message,wParam,lParam)
Exit Function
End Select
EventCall_MainWnd=0
End Function
Function MainWndProc(hWnd As HWND, dwMsg As DWord, wParam As WPARAM, lParam As LPARAM) As DWord
MainWndProc=EventCall_MainWnd(hWnd,dwMsg,wParam,lParam)
End Function
Sub MainWnd_Destroy()
DeleteObject(hFont_MainWnd)
DeleteObject(h3DFaceBrush)
PostQuitMessage(0)
End Sub
Sub SeeMainWnd()
*A
Do
If GetAsyncKeyState(5)>0 then
GetCursorPos(mouse)
If mouse.x<=111 and mouse.y>=Desk.bottom-30 then Exit Do
End If
Loop
ShowWindow(hMainWnd,SW_SHOW)
Do
GetCursorPos(mouse)
If mouse.y<Start.bottom then Exit Do
Sleep(20)
Loop
Do
If GetAsyncKeyState(1) or GetAsyncKeyState(2) or GetAsyncKeyState(4) or GetAsyncKeyState(5) or GetAsyncKeyState(6) And &H8000 then
GetCursorPos(mouse)
If mouse.x>Start.right then Exit Do
If mouse.y<Start.top then Exit Do
If mouse.x<Start.left then Exit Do
If mouse.y>Start.bottom then Exit Do
End If
Sleep(20)
Loop
ShowWindow(hMainWnd,SW_HIDE)
goto *A
End Sub
Sub MainWnd_Move(x As Integer, y As Integer)
MoveWindow(hMainWnd,Start.left,Start.top,Start.right,Start.bottom,TRUE)
End Sub