|
|
2019/9/4(Wed) 23:39:57|NO.88324
子ウィンドウを最大化すると、下に白い空白(?)が出てしまうのですが、どうすれば消えますか?
#uselib "user32.dll"
#func SetParent "SetParent" int,int
#cfunc GetWindowLong "GetWindowLongA" int,int
#func SetWindowLong "SetWindowLongA" int,int,int
bgscr 0,ginfo_dispx,ginfo_dispy,2,0,0
winx=ginfo_winx:winy=ginfo_winy
mainwindow=hwnd
screen 1,400,240,4|2
SetParent hwnd,mainwindow
screen 2,winx,winy,4|2,,,400,240;最大化ウィンドウ
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$10000|$40000
SetParent hwnd,mainwindow
gsel 1,1:gsel 2,1:gsel 0,1
|
|
2019/9/5(Thu) 20:34:52|NO.88331
子ウィンドウにはウィンドウスタイルでWS_CHILDを指定する
>SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$10000|$40000
に $40000000 を追加
|
|
2019/9/8(Sun) 00:02:30|NO.88353
暇人さん。ありがとうございます。
ですが、ウィンドウID2が手前に表示されてしまうのですが、どうすればいいのでしょうか?
#uselib "user32.dll"
#func SetParent "SetParent" int,int
#cfunc GetWindowLong "GetWindowLongA" int,int
#func SetWindowLong "SetWindowLongA" int,int,int
bgscr 0,ginfo_dispx,ginfo_dispy,2,0,0
winx=ginfo_winx:winy=ginfo_winy
mainwindow=hwnd
screen 1,400,240,4|2
SetParent hwnd,mainwindow
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$40000000
screen 2,winx,winy,2,,,400,240;最大化ウィンドウ
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$10000|$40000000
SetParent hwnd,mainwindow
gsel 1,1:gsel 2,1:gsel 0,1
|
|
2019/9/8(Sun) 22:21:31|NO.88377
単に実行時にScreen1が上に来れば良いだけなら
Screenの作成する順番を入れ替えれば良い
Screen1を常に最前面にしたいなら工夫が必要かも・・・
|
|
2020/4/14(Tue) 23:03:10|NO.90105
スレの見落としです。返信が遅くなってすみません。
gselの2つのパラメーターに1を2に変えてみたのですが、ダメでした。
#uselib "user32.dll"
#func SetParent "SetParent" int,int
#cfunc GetWindowLong "GetWindowLongA" int,int
#func SetWindowLong "SetWindowLongA" int,int,int
bgscr 0,ginfo_dispx,ginfo_dispy,2,0,0
winx=ginfo_winx:winy=ginfo_winy
mainwindow=hwnd
screen 1,400,240,4|2
SetParent hwnd,mainwindow
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$40000000
screen 2,winx,winy,2,,,400,240;最大化ウィンドウ
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$10000|$40000000
SetParent hwnd,mainwindow
gsel 1,2:gsel 2,1:gsel 0,1
|
|
2020/4/15(Wed) 00:03:56|NO.90106
単純にZオーダーを変更するだけならSetWindowPos関数で可能です。
#uselib "user32.dll"
#func SetParent "SetParent" int,int
#cfunc GetWindowLong "GetWindowLongA" int,int
#func SetWindowLong "SetWindowLongA" int,int,int
#func SetWindowPos "SetWindowPos" int, int, int, int, int, int, int
bgscr 0,ginfo_dispx,ginfo_dispy,2,0,0
winx=ginfo_winx:winy=ginfo_winy
mainwindow=hwnd
screen 1,400,240,4|2
SetParent hwnd,mainwindow
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$40000000
child1 = hWnd; // 子ウィンドウ1のハンドル
screen 2,winx,winy,2,,,400,240;最大化ウィンドウ
child2 = hWnd; // 子ウィンドウ2のハンドル
SetWindowLong hwnd,-16,GetWindowLong(hwnd,-16)|$10000|$40000000
SetParent hwnd,mainwindow
gsel 1,2:gsel 2,1:gsel 0,1
// 子ウィンドウ1を前にする(ウィンドウの位置や大きさは変えない)
SetWindowPos child2, child1, 0, 0, 0, 0, 0x0001 | 0x0002; // SWP_NOSIZE | SWP_NOMOVE
ただ、最大化すると最前面になったり、
最小化から戻した時に順番が変わるので
割り込み処理も併用するといいかもです。
|
|
2020/4/18(Sat) 11:42:02|NO.90128
あらやさん 回答ありがとうございます。
SetWindowPosでZオーダーを変えることができましたが、一応解決にしておきます。
|
|