透明なウィンドウ
Posted: 2005年10月18日(火) 20:20
Win98でも動くような透明なウィンドウを作りたいのですがどうすればよいのでしょうか。どなたかアドバイスお願いします。
> Win98でも動くような透明なウィンドウを作りたいのですがどうすればよいのでしょうか。どなたかアドバイスお願いします。
コード: 全て選択
Dim VirWindowPos As RECT'仮想ウインドウのグローバル位置
VirWindowPos.top=0
VirWindowPos.bottom=400
VirWindowPos.left=0
VirWindowPos.right=600
Dim VirButton1Pos As RECT'仮想ボタンのローカル位置
VirButton1Pos.top=50
VirButton1Pos.bottom=350
VirButton1Pos.left=50
VirButton1Pos.right=550
Dim CursorPos As POINTAPI'マウス位置
Function isin(ByRef Glo As RECT,ByRef But As RECT,ByRef Cur As POINTAPI) As Long
Dim GloBut As RECT
Dim FlagA As Long
FlagA=0
GloBut.top=Glo.top+But.top
GloBut.left=Glo.left+But.left
GloBut.bottom=Glo.top+But.bottom
GloBut.right=Glo.left+Glo.right
If GloBut.top<Cur.y then FlagA=FlagA+1
If GloBut.bottom>Cur.y then FlagA=FlagA+1
If GloBut.left<Cur.x then FlagA=FlagA+1
If GloBut.right>Cur.x then FlagA=FlagA+1
If FlagA=4 then isin=-1 else isin=0
End Function
*A
GetCursorPos(CursorPos)
If GetAsyncKeyState(1) And &h8000 Then'左クリックをしたら
If isin(VirWindowPos,VirButton1Pos,CursorPos)=-1 then
'仮想ボタン1をクリックした時にする反応
MsgBox GetDesktopWindow(), "Button1_Clicked"
End If
'仮想ボタンを追加したらここに追記する
End IF
If GetAsyncKeyState(2) And &h8000 Then End'ミギクリで終了
goto *A
コード: 全て選択
'-----------------------------------------------------------------------------
' イベント プロシージャ
'-----------------------------------------------------------------------------
' このファイルには、ウィンドウ [MainWnd] に関するイベントをコーディングします。
' ウィンドウ ハンドル: hMainWnd
' TODO: この位置にグローバルな変数、構造体、定数、関数を定義します。
Function MainWndProc(hWnd As DWord, dwMsg As DWord, wParam As DWord, lParam As DWord) As DWord
' TODO: この位置にウィンドウメッセージを処理するためのコードを記述します。
' イベントプロシージャの呼び出しを行います。
Select Case dwMsg
Case WM_PAINT, WM_NCPAINT, WM_ERASEBKGND
If dwMsg=WM_PAINT Then
ValidateRect(hWnd,Byval NULL)
End If
MainWndProc=0
Exit Function
End Select
MainWndProc=EventCall_MainWnd(hWnd,dwMsg,wParam,lParam)
End Function
'-----------------------------------------------------------------------------
' ここから下は、イベントプロシージャを記述するための領域になります。
Sub MainWnd_Destroy()
***_DestroyObjects()
PostQuitMessage(0)
End Sub
コード: 全て選択
WINDOW:MainWnd
HANDLE = hMainWnd
POINT = -2147483648,-2147483648
SIZE = 480,360
CAPTION = ""
STYLE = &H80000000
EXSTYLE = &H00000028
ID = 0
BGCOLOR = 15
FONT = -12,0,0,0,400,0,0,0,128,3,2,1,32,"MS Pゴシック"
CLASS = "NORMAL"
CALLBACK = MainWndProc
TYPE = 0
FILEPATH = MainWnd.sbp
END