on Windows Platform, I need this function:
the program shows messages at bottom of the screen, the words in message cannot be selected or clicked, and the background totally transparent, also withou a "x" to close the dialog, just the word appear, then disappers after 1 second automatically,
how to do this? I searched but no proper result in rust topics, thanks.
maybe win32com api? if so, would you please give me a example to do that, thanks advanced.
So you want to display text with transparent background at the bottom of the screen, i.e. not contained within a window or anything? I mean, I would question why such stylistic choices, arguably staying within your window, or using standard things like e.g. toast notification (which obviously don't have a transparent background) might be nicer.
For the desired effect… I’m by no means very knowledgeable with Windows at all, and also don’t have any Windows at hand to test anything on, but IIRC, I’ve seen fancy stuff being pulled of on Windows by using something like a borderless and transparent-background window, so if you created something like that, positioned it accordingly, and somehow made it non-interactable, as desired, that could be an approach. For the specific way of doing something like that in Rust, others can probably be of more help : - )
Thanks for the information, the background no need to be transparent, I just want it non interactable, without the close button, borderless, disappear automatically after seconds..
With typical toast notifications, automatically disappearing after 1 second should be possible, and avoiding interactability and x buttons might be possible (I’m not sure; ChatGPT claimed something about a “
scenario” of “reminder” and/or “alarm” that could help with the x button… and I found some API for it in at least one Rust crate).
Using toast notifications, within the limits of what they provide, would of course ensure a more native experience compared to building something yourself with e.g. “weirdly” customized borderless windows.
Edit: Oh well… Clicking the link to the microsoft documentation from that
Scenario enum shows that apparently non-interactable toasts might be hard or impossible; at least it says
You must provide at least one button on your app notification. Otherwise, the notification will be treated as a normal notification.
For both reminder and alarm.
Edit2: Some stack overflow discussion I came across suggests that “incoming call” scenario might do the trick?
As noted above, I don’t have any machine at hand to test any of this, but feel free to explore whether or not the linked crate can be used to create something appropriate for your use-case.