Replies: 3 comments 8 replies
-
I don't believe it is possible to get a window handle before Alternatively, if this is a one-time thing, you could pass data as context from your |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot for your answer. I still can't figure out how to do this. In my Because |
Beta Was this translation helpful? Give feedback.
-
Thanks a lot, I got the chain running until The code has gotten pretty lengthy and complicated, so I will try to make things simple and beautiful. "Single instance" should be a feature I can easily enable or disable for a particular app. When and how often is the Umh, there is so much for me to learn here, I'm not even a web developer, been doing Rust only for a few months now, and I don't feel very comfortable with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I want my app to have a systray icon. Thus, it makes sense for the app to be single-instance only. Using the
interprocess
crate, I managed to receive command-line args from another instance of the app, which sends the command line to the already-running instance and then exits itself.Now, the first instance of the app should activate its window and grab the focus. How would I do that? I need to get a handle of the main window and call
set_focus
on it. I'm basically inmain
, with no component context whatsoever. Can this be done?Beta Was this translation helpful? Give feedback.
All reactions