Jump to content

Top Most Window


Go to solution Solved by Josh,

Recommended Posts

Posted

Hello,

I can't find out how to make my window top most, does anyone know how to make the window top most if a checkbox is selected ?

Because the code see if it's selected or no but I can't find any element to make it top most.

Regards.

Posted
2 minutes ago, Josh said:

I think Window::Activate() will select the window and bring it to the top.

Well the problem is I don't want to bring it to the top with a loop but I want to make it top most until I uncheck the checkbox

Posted
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 !

Posted

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
Posted
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!

Posted
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 !

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.

×
×
  • Create New...