Added some APIs to the widget class

This commit is contained in:
cnjinhao
2014-12-21 11:15:39 +08:00
parent e5aeb8420f
commit f62ad0aa9f
9 changed files with 120 additions and 86 deletions

View File

@@ -933,7 +933,7 @@ namespace nana{
#endif
}
void native_interface::bring_to_top(native_window_type wd)
void native_interface::bring_top(native_window_type wd, bool activated)
{
#if defined(NANA_WINDOWS)
HWND native_wd = reinterpret_cast<HWND>(wd);
@@ -944,7 +944,7 @@ namespace nana{
HWND fg_wd = ::GetForegroundWindow();
DWORD fg_tid = ::GetWindowThreadProcessId(fg_wd, nullptr);
::AttachThreadInput(::GetCurrentThreadId(), fg_tid, TRUE);
::ShowWindow(native_wd, SW_SHOWNORMAL);
::ShowWindow(native_wd, activated ? SW_SHOWNORMAL : SW_SHOWNOACTIVATE);
::SetWindowPos(native_wd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
::SetWindowPos(native_wd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
::AttachThreadInput(::GetCurrentThreadId(), fg_tid, FALSE);