〜 ウィンドウ 〜
枠以外を掴んでサイズ変更

自ウィンドウへ「WM_SYSCOMMAND(=0x0112)」メッセージと共に「SC_SIZE(=0xF000)」を指定すれば、
マウスカーソルがウィンドウ枠位置に移動してウィンドウサイズが変更できますが、SC_SIZEパラメータに
「WMSZ_LEFT(=0x0001)」を加えた0XF001を指定すれば、ウィンドウ左側を
「WMSZ_RIGHT(=0x0002)」を加えた0XF002を指定すれば、ウィンドウ右側を
「WMSZ_TOP(=0x0003)」を加えた0XF003を指定すれば、ウィンドウ上側を
「WMSZ_TOPLEFT(=0x0004)」を加えた0XF004を指定すれば、ウィンドウ左上を
「WMSZ_TOPRIGHT(=0x0005)」を加えた0XF005を指定すれば、ウィンドウ右上を
「WMSZ_BOTTOM(=0x0006)」を加えた0XF006を指定すれば、ウィンドウ下側を
「WMSZ_BOTTOMLEFT(=0x0007)」をを加えた0XF007指定すれば、ウィンドウ左下を
「WMSZ_BOTTOMRIGHT(=0x0008)」を加えた0XF008を指定すれば、ウィンドウ右下を
ウィンドウ枠を掴んでの伸縮処理と同じ様にマウスのドラッグ&ドロップで伸縮できる様になります。
命令の基本的な説明についてはコチラに書いていますが、
HSP2、HSP3でのスクリプト記述方法を参考までに書いておきます。
HSP2「objsend 13 - 41, 0x0112, 0xF001, 不使用変数(=0), 0」
HSP3「sendmsg hwnd, 0x0112, 0xF001, 不使用(=0)
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#module
#deffunc winstretch int, int, int, int, int
	mref dir, 0 : mref left, 1 : mref top, 2 : mref right, 3 : mref bottom, 4
	i = mousex, mousey
	if i >= left & (i <= right) & (i.1 >= top) & (i.1 <= bottom) {
		if dir < 0 : i = 0XF000 : else : if dir > 8 : i = 0xF008 : else : i = 0xF000 + dir
		objsend -28, 0x0112, i, nonuse
	}
	return
#global

	screen 2, dispx, dispy, , , , 400, 400
	title "色付きエリア内、または外枠のみ伸縮処理可能"
	r = 10, 10, winx - 10, winy - 10
	color 240, 240, 240
	boxf r.0, r.1, r.2, r.3
	color 255
	line  50,  50, 350, 350
	line  50,  50,  50, 100 : line  50,  50, 100,  50
	line 350, 350, 300, 350 : line 350, 350, 350, 300
	color , , 255
	pos  20,  20 : mes "縮める"
	pos 340, 360 : mes "伸ばす"
	repeat
		wait 1
		stick key, , 1
		if key & 256 = 0 : continue
		winstretch 8, r.0, r.1, r.2, r.3
	loop
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#module
#deffunc winstretch int dir, int left, int top, int right, int bottom, local i
	i = mousex, mousey
	if i >= left & i <= right & i.1 >= top & i.1 <= bottom {
		sendmsg hwnd, 0x0112, 0xF000 + limit(dir, 0, 8)
	}
	return
#global

	screen 0, ginfo_dispx, ginfo_dispy, , , , 400, 400
	title "色付きエリア内、または外枠のみ伸縮処理可能"
	r = 10, 10, ginfo_winx - 10, ginfo_winy - 10
	color 240, 240, 240
	boxf r.0, r.1, r.2, r.3
	color 255
	line  50,  50, 350, 350
	line  50,  50,  50, 100 : line  50,  50, 100,  50
	line 350, 350, 300, 350 : line 350, 350, 350, 300
	color , , 255
	pos  20,  20 : mes "縮める"
	pos 340, 360 : mes "伸ばす"
	repeat
		wait 1
		stick key, , 1
		if (key & 256) = 0 : continue
		winstretch 8, r.0, r.1, r.2, r.3
	loop