Jump to content

Top Most Window


TheHellTower
 Share

Go to solution Solved by Josh,

Recommended Posts

  • Solution

Ah, okay. You can use GetHandle() and start using the Win32 API. This won't be cross-platform, but it will work on Windows:

SetWindowPos(window->GetHandle(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

https://stackoverflow.com/questions/14989062/set-a-window-to-be-topmost

  • Like 2

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

9 minutes ago, Josh said:

Ah, okay. You can use GetHandle() and start using the Win32 API. This won't be cross-platform, but it will work on Windows:

SetWindowPos(window->GetHandle(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

https://stackoverflow.com/questions/14989062/set-a-window-to-be-topmost

Yeah at start I searched for a handle then I was thinking if it would work with UAK but yeah perfect then thanks !

Link to comment
Share on other sites

Final:

if (THTtmcb->GetState() == WIDGETSTATE_SELECTED) {
	SetWindowPos(window->GetHandle(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
} else if(THTtmcb->GetState() == WIDGETSTATE_UNSELECTED) {
	SetWindowPos(window->GetHandle(), HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}

 

  • Like 1
Link to comment
Share on other sites

58 minutes ago, Josh said:

Ah, okay. You can use GetHandle() and start using the Win32 API. This won't be cross-platform, but it will work on Windows:

SetWindowPos(window->GetHandle(), HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

https://stackoverflow.com/questions/14989062/set-a-window-to-be-topmost

Hopefully there can be a window function that does this cross platform. This is useful to ensure a window is shown on top after a splash window.

 

Cyclone - Ultra Game System - Component PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

2 minutes ago, reepblue said:

Hopefully there can be a window function that does this cross platform. This is useful to ensure a window is shown on top after a splash window.

That would be nice yeah but then it would be better if you can pass a boolean to set it top most or no, but I personally prefer when splash are top most I don't think it's really important for software form itself.

The "Vectronic" topic doesn't exist anymore in your signature !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...