From 75653f452fbe437a9bea82a2a3d3764f29950983 Mon Sep 17 00:00:00 2001 From: Miteruzo Date: Tue, 6 Jun 2023 00:24:53 +0900 Subject: [PATCH] =?UTF-8?q?=E3=82=A6=E3=82=A3=E3=83=B3=E3=83=89=E3=82=A6?= =?UTF-8?q?=E3=81=AE=E4=B8=8A=E3=81=AB=E4=B9=97=E3=82=8C=E3=82=8B=E3=82=88?= =?UTF-8?q?=E3=81=86=E3=81=AB=EF=BC=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.hsp | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 47 insertions(+), 5 deletions(-) diff --git a/main.hsp b/main.hsp index c66a9b3..ce8c725 100644 --- a/main.hsp +++ b/main.hsp @@ -7,8 +7,8 @@ #const NIZIKA_WIDTH 300 #const NIZIKA_HEIGHT 300 -#const NIZIKA_BASE 240 -#const NIZIKA_LEFT 60 +#const NIZIKA_BASE 236 +#const NIZIKA_LEFT 100 #const NIZIKA_RIGHT 250 @@ -17,6 +17,8 @@ SetWindowLong hWnd, GWL_EXSTYLE, GetWindowLong (hWnd, GWL_EXSTYLE) Or WS_EX_LAYERED SetLayeredWindowAttributes hWnd, RGBCOLOUR_LIME, False, True + HWND_DESKTOP = GetDesktopWindow () ; デスクトップ取得 + Color COLOUR_LIME BoxF @@ -34,8 +36,38 @@ moving = False falling = True + base = gInfo_dispY Repeat + Dim hWindows, 1 + Dim windowRects, 4, 1 + + hWindows.0 = GetTopWindow (HWND_DESKTOP) + hWindowBefore = hWindows.0 + GetWindowRect hWindows.0, VarPtr (windowRects.0.0) + + windowCnt = 1 + + Repeat + hWindow = GetWindow (hWindowBefore, GW_HWNDNEXT) + + If hWindow = 0 { + Break + } + + buf = "" + GetWindowText hWindow, VarPtr (buf), 256 + + If (IsWindowVisible (hWindow) != False) And (StrLen (buf) != 0) { + hWindows.windowCnt = hWindow + GetWindowRect hWindow, VarPtr (windowRects.0.windowCnt) + + windowCnt++ + } + + hWindowBefore = hWindow + Loop + If GetKey2 (KEY_MOUSE_L) { If moving { nizikaX = LimitF (mouseX - offsetX, -NIZIKA_LEFT, gInfo_dispX - NIZIKA_RIGHT) @@ -55,12 +87,22 @@ fallVel = 0. } Else: If falling { - nizikaY = LimitF (nizikaY + fallVel, Null, gInfo_dispY - NIZIKA_BASE) + nizikaY = LimitF (nizikaY + fallVel, Null, base - NIZIKA_BASE) fallVel += 9.8 - If nizikaY >= gInfo_dispY - NIZIKA_BASE { - falling = False + If nizikaY >= base - NIZIKA_BASE { + fallVel = 0. } + + base = gInfo_dispY + + Repeat windowCnt + If (windowRects.0.cnt <= nizikaX + (NIZIKA_WIDTH - NIZIKA_LEFT)) And (nizikaX + NIZIKA_LEFT < windowRects.2.cnt) { + If (nizikaY + NIZIKA_BASE <= windowRects.1.cnt) And (windowRects.1.cnt < base) { + base = windowRects.1.cnt + } + } + Loop } ReDraw False