[MAXGUI] Window always on top?
BlitzMax Forums/BlitzMax Programming/[MAXGUI] Window always on top?
| ||
Hi! I'm currently using these two functions to set the window flag to "always on top". Function WinalwaysOnTop(hWnd:Long) SetWindowPos( hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE ) End Function Function WinnotAlwaysOnTop(hWnd:Long) SetWindowPos( hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE + SWP_NOMOVE ) End Function The problem is that when I use tooltips in maxgui listboxes they no longer show up / shop up behind the listbox. So one can't read the text. Is there a better way of locking the gui app window on top? Thanks, Grisu |
| ||
You shouldn't make windows on top of all others. It's an ugly Windows hack that should die. What if two windows want to be on top at the same time? I rest my case ;) |
| ||
Well lets say you work in open office and want to use winamp. That's when "always on top" is quite nice, cause you can work as you like and still play your songs... |
| ||
Try forcing the listboxe's hWnd to the top - might work ;) |
| ||
but how? I'm no windows api gutu. And it seems if I touch something, it breaks something elsewhere... :/ I have around 10 Listboxes in my app...and i want to allow the user to set the window on top or not on the fly. So this isnt easy... :/ |
| ||
Get the listboxe's hWnd with QueryGadget (QUERY_HWND) and force it to the top the same way you do the parent window. Like I said, it may or may not work, but it's worth a shot. Good luck with it! |
| ||
Can't I just move the window to "ONTOP"-1? That would be better than moving all listbox tooltips. Don't know how to code this though.. :( |
| ||
Yes, but you said that it caused your listbox tooltips to vanish, so I thought that also forcing the listbox itself to the top might help. |
| ||
sorry, i will try to explain. The function sets the window to the top. therefore the tooltips show up behind. So I "just" need to change the function so it sets the window itself to "HWND_TOPMOST-1". |
| ||
I just tried to set the listbox to top and it didn't fix the problem, please forget I ever mentioned it. There is no such layer between HWND_TOP and HWND_TOPMOST. Tooltips reside on the TOPMOST layer by default, so in theory they should be visible. Maybe talk to skid about it. Code to recreate the problem: Window:TGadget = CreateWindow("Test", 0, 0, 500, 500) SetWindowPos QueryGadget(Window, QUERY_HWND), -1, 0, 0, 0, 0, 3 ListBox:TGadget = CreateListBox(0, 0, 400, 400, Window) AddGadgetItem ListBox, "test", 0, -1, "Tip" SetWindowPos QueryGadget(ListBox, QUERY_HWND), -1, 0, 0, 0, 0, 3 ' Attempted fix Repeat Until WaitEvent() = EVENT_WINDOWCLOSE |
| ||
Thanks Eikon for looking into this. Skid will probably kill me when I report this... *shivers* He has lot's of other stuff to fix first (higher priority)... |