Comments (4)
Resolved by adding...
::SetWindowPos(
Fmx::Platform::Win::ApplicationHWND(),
HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE
);
after
trayIcon_->Show();
Example:
void TfrmMain::MinimizeToTrayBar()
{
Hide();
trayIcon_->Show();
::SetWindowPos(
Fmx::Platform::Win::ApplicationHWND(),
HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE
);
HideAppOnTaskbar();
}
Regards
from fmxtrayicon.
Oh, thank you very much. I have not made edits for a long time, and I myself have used it for a long time. But I think it's time to fix it. Thanks again. Maybe today I will fix it using your suggestion
from fmxtrayicon.
Fixed popup menu display. Do additional actions before or after - not necessary
from fmxtrayicon.
Hi.
I noticed that after minimizing the main window in the tray icon as per the code in the previous posts, when I would restore the window it would always remain topmost, always overstanding all other applications. Since this is an annoying problem, I solved it by declaring HWND_NOTOPMOST in the call to SetWindowPos when restoring from the tray bar (by double-clicking on the tray icon).
void TfrmMain::RestoreFromTrayBar()
{
::SetWindowPos(
Fmx::Platform::Win::WindowHandleToPlatform( Handle )->Wnd,
HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_SHOWWINDOW
);
trayIcon_->Hide();
ShowAppOnTaskbar();
}
Note, however, that this time I did not use the application handle, but the main window handle.
To recap: when minimizing you should use the application handle and the HWND_TOPMOST flag in the SetWindowPos, and when restoring you should use the main window handle and HWND_NOTOPMOST when calling the SetWindowsPos.
from fmxtrayicon.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fmxtrayicon.