|
|
2015/3/31(Tue) 00:05:04|NO.68221
開閉ウィンドウを作ってみたのですが、
開くタイミングでbgscrが見えているかどうかによってちらつきが発生するようです。
以下の定数のvisibleを1にするとちらつきはなくなりますが、
この現象の根本的な解決方法がございましたらご教示ください。
#include "user32.as"
#define visible 0
#define parent_height 100
#define child_height 200
screen 0, ginfo_dispx, ginfo_dispy, 0, , , 300, parent_height
parent_hwnd = hwnd
bgscr 1, ginfo_winx, child_height, 0, 0, ginfo_winy - visible
SetWindowLong hwnd, -16, $50000000
SetParent hwnd, parent_hwnd
color : boxf
gsel 0
repeat
flag ^= 1
if flag = 0 {
width ginfo_winx, parent_height
} else {
width ginfo_winx, parent_height + child_height
}
await 250
loop
|
|
2015/3/31(Tue) 01:46:11|NO.68222
> この現象の根本的な解決方法がございましたらご教示ください。
親ウインドウのウインドウ・スタイルに「WS_CLIPCHILDREN」を追加するだけです。
http://chokuto.ifdef.jp/urawaza/prm/window_style.html
↑
ここを参考に。
#include "User32.as"
#define visible 0
#define parent_height 100
#define child_height 200
//--------------------------------------
// 記号定数(API定数)
//--------------------------------------
#const NULL $00000000
#const WS_CLIPCHILDREN $02000000
#const WS_VISIBLE $10000000
#const WS_CHILD $40000000
#const GWL_STYLE $FFFFFFF0
#const SWP_NOACTIVATE $00000010
#const SWP_NOSIZE $00000001
#const SWP_NOMOVE $00000002
#const SWP_NOZORDER $00000004
#const SWP_NOOWNERZORDER $00000200
#const SWP_FRAMECHANGED $00000020
screen 0, ginfo_dispx, ginfo_dispy, 0, , , 300, parent_height
parent_hwnd = hWnd
GetWindowLong hWnd, GWL_STYLE
SetWindowLong hWnd, GWL_STYLE, stat|WS_CLIPCHILDREN
SetWindowPos hWnd,NULL,0,0,0,0,(SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_NOOWNERZORDER|SWP_FRAMECHANGED)
bgscr 1, ginfo_winx, child_height, 0, 0, ginfo_winy - visible
;GetWindowLong hWnd, GWL_STYLE
;SetWindowLong hWnd, GWL_STYLE, stat|WS_CHILD|WS_VISIBLE
SetParent hWnd, parent_hwnd
color : boxf
gsel 0
repeat
flag ^= 1
if flag = 0 {
width ginfo_winx, parent_height
} else {
width ginfo_winx, parent_height + child_height
}
await 250
loop
| |
|
2015/3/31(Tue) 11:49:12|NO.68226
> 科学太郎さん
ご回答ありがとうございます。
実はWS_CLIPCHILDRENの付与はすでに試したのですが、問題は解消されずにいます。
実際に科学太郎さんのソースでもちらつきは発生するのですが、再現性はありませんか?
|
|
2015/3/31(Tue) 15:13:03|NO.68232
> 実際に科学太郎さんのソースでもちらつきは発生するのですが、再現性はありませんか?
ちらついてますか?
こちらは Windows8.1 の環境です。
ただの錯覚だとか。
どうなのでしょうね。
|
|
2015/3/31(Tue) 15:38:57|NO.68233
Windows7ですが、冒頭で述べたようにvisibleの値いかんでちらつきますね。
一目瞭然になるようにソースを書き直してみました。
#include "user32.as"
#define parent_height 100
#define child_height 200
screen 0, ginfo_dispx, ginfo_dispy, 0, 200, 200, 300, parent_height
title "ちらつかない方"
parent_hwnd = hwnd
bgscr 1, ginfo_winx, child_height, 0, 0, ginfo_winy - 1
SetWindowLong hwnd, -16, $50000000
SetParent hwnd, parent_hwnd
color : boxf
screen 2, ginfo_dispx, ginfo_dispy, 4, 550, 200, 300, parent_height
title "ちらつく方"
parent_hwnd = hwnd
bgscr 3, ginfo_winx, child_height, 0, 0, ginfo_winy - 0
SetWindowLong hwnd, -16, $50000000
SetParent hwnd, parent_hwnd
color : boxf
repeat
flag ^= 1
if flag = 0 {
gsel 0 : width ginfo_winx, parent_height
gsel 2 : width ginfo_winx, parent_height
} else {
gsel 0 : width ginfo_winx, parent_height + child_height
gsel 2 : width ginfo_winx, parent_height + child_height
}
await 250
loop
|
|
2015/3/31(Tue) 16:09:18|NO.68234
次のサンプルではどうですか?
#include "user32.as"
#define parent_height 100
#define child_height 200
//--------------------------------------
// 記号定数(API定数)
//--------------------------------------
#const NULL $00000000
#const WS_CLIPCHILDREN $02000000
#const WS_VISIBLE $10000000
#const WS_CHILD $40000000
#const GWL_STYLE $FFFFFFF0
#const SWP_NOACTIVATE $00000010
#const SWP_NOSIZE $00000001
#const SWP_NOMOVE $00000002
#const SWP_NOZORDER $00000004
#const SWP_NOOWNERZORDER $00000200
#const SWP_FRAMECHANGED $00000020
screen 0, ginfo_dispx, ginfo_dispy, 0, 200, 200, 300, parent_height
title "ちらつかない方"
parent_hwnd = hwnd
hWnd1=hwnd
bgscr 1, ginfo_winx, child_height, 0, 0, ginfo_winy - 1+1
SetWindowLong hwnd, -16, $50000000
SetParent hwnd, parent_hwnd
color : boxf
screen 2, ginfo_dispx, ginfo_dispy, 4, 550, 200, 300, parent_height
title "ちらつく方"
parent_hwnd = hwnd
hWnd2=hwnd
bgscr 3, ginfo_winx, child_height, 0, 0, ginfo_winy - 0+1
SetWindowLong hwnd, -16, $50000000
SetParent hwnd, parent_hwnd
color : boxf
repeat
flag ^= 1
if flag = 0 {
sx=6+ginfo_winx
sy=6+parent_height
} else {
sx=6+ginfo_winx
sy=6+parent_height + child_height
}
SetWindowPos hWnd1,NULL,0,0,sx,sy,(SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER)
SetWindowPos hWnd2,NULL,0,0,sx,sy,(SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER|SWP_NOOWNERZORDER)
await 250
loop
| |
|
2015/3/31(Tue) 16:18:32|NO.68235
この例ですと両方ともちらつきますね。
やはりクローズ時にほんの少しでもbgscrが見えていることが条件のようです。
|
|
2015/3/31(Tue) 16:56:58|NO.68236
単一のウィンドウでも再現できるので、ウィンドウサイズ変更時に完全に隠れていた部分の再描画に問題がある?
|
|