|
Post by donnybowers on Nov 21, 2018 23:32:50 GMT -5
I'm having trouble setting the Z order I want for a window using STYLEBITS: BOTTOM, NOTOPMOST, TOP, TOPMOST. The only one that works for me is TOPMOST.
I have a program that has a main window and then calls various other windows to sit on top of it. These are basically LISTBOXes that call up various files in a text editor. The text editor is set for "stay on top". But when I use TOPMOST for my listboxes the text editor comes up behind it. I'm thinking NOTOPMOST or TOP would work better for my LISTBOX windows, but as I say, for some reason the only one that works with STYLEBITS is TOPMOST.
I run LB under WINE, so I'm wondering if that might be the problem. I'm also wondering if there's an API workaround. I know WINE must be able to handle most Windows API's because they work in other applications (like the text editor I'm using which I believe is using the TOP Z order). Having these different Z levels would be a huge improvement to my program.
stylebits #main, 0,0,_WS_EX_NOTOPMOST,0 stylebits #main, 0,0,_WS_EX_TOP,0
|
|
|
Post by Rod on Nov 22, 2018 4:06:40 GMT -5
You can show and hide controls, different strategy but it saves getting embroiled in API.
nomainwin lba$(1)="This is listbox A" lbb$(1)="This is listbox B" WindowWidth = 600 WindowHeight=400 listbox #1.lba, lba$(, [selecta], 20, 30, 200, 300 listbox #1.lbb, lbb$(, [selectb], 20, 30, 200, 300 button #1.ba,"List Box A",[boxa],UL 20,10,100,20 button #1.ba,"List Box B",[boxb],UL 120,10,100,20 open "Show and Hide" for window as #1 #1.lbb "hide" #1.lba "show" #1, "trapclose [quit]"
wait
[boxa] #1.lbb "hide" #1.lba "show" wait
[boxb] #1.lba "hide" #1.lbb "show" wait
[quit] close #1 end
|
|
|
Post by Chris Iverson on Nov 23, 2018 0:09:40 GMT -5
Where did you hear about the other stylebits? The only one I'm aware of is WS_EX_TOPMOST. Here's the documented list of extended window styles. The only one there is WS_EX_TOPMOST.
|
|
|
Post by donnybowers on Nov 28, 2018 0:54:30 GMT -5
Where did you hear about the other stylebits? The only one I'm aware of is WS_EX_TOPMOST. Here's the documented list of extended window styles. The only one there is WS_EX_TOPMOST. I found it Here.
|
|
|
Post by tsh73 on Nov 28, 2018 2:42:26 GMT -5
donnybowers, apparently it is not stylebits. It is Windows constants - but for another function.
|
|
|
Post by Chris Iverson on Nov 28, 2018 11:07:46 GMT -5
donnybowers, apparently it is not stylebits. It is Windows constants - but for another function. This. If you want to use those flags, you need to use them in conjunction with the SetWindowPos() API call. Also note that this is temporary arrangement of the Z-order; it does not permanently "stick" a window in place. Here's an example call to the SetWindowPos function, specifically to change Z-Order. You need to get the hMain handle from one of your windows. You can also use the second parameter to set the z-order of a window to specifically behind another window. a = SetWindowZOrder(hMain, _HWND_NOTOPMOST)
Function SetWindowZOrder(hWnd, hWndInsertAfter) 'Tell SetWindowPos() that we're not moving or resizing the window, 'just changing Z-order. ' 'This way, it will ignore what we pass for window position and 'window size parameters. uFlags = _SWP_NOSIZE or _SWP_NOMOVE SetWindowZOrder = SetWindowPos(hWnd, hWndInsertAfter, 0, 0, 0, 0, uFlags) End Function
Function SetWindowPos(hWnd, hWndInsertAfter, x, y, cx, cy, uFlags) CallDLL #user32, "SetWindowPos",_ hWnd as ulong,_ hWndInsertAfter as long,_ x as long,_ y as long,_ cx as long,_ cy as long,_ uFlags as long,_ SetWindowPos as long End Function
|
|