Simple question. Why does the first call of an OpenFileRequester() forces an icon refresh on desktop?
And how can i turn off this annoying flickering?


Regards,
Mischa
Just your PC. Doesn't happen on both my PCs here.Mischa wrote:Why does the first call of an OpenFileRequester() forces an icon refresh on desktop?
I'm on a updated Win10 highend corparate laptop [nothing funny installed] and also get a icon update on the desktop with just:BarryG wrote:Just your PC. Doesn't happen on both my PCs here.Mischa wrote:Why does the first call of an OpenFileRequester() forces an icon refresh on desktop?
Code: Select all
OpenFileRequester("", "", "", 0)
Code: Select all
OpenWindow(0,200,200,200,200,"",#PB_Window_Invisible)
OpenFileRequester("", "", "", 0)
Yes, it makes no difference.BarryG wrote:Does it still happen if you open a temp invisible window first? Like this:
Code: Select all
OpenWindow(0,200,200,200,200,"",#PB_Window_Invisible) OpenFileRequester("", "", "", 0)
Thanks for the info.cas wrote:This is not a bug, it is just the way that Windows OS works. Here are some explanations that i found with a quick google search that explain what is happening and how to possibly prevent it:
https://stackoverflow.com/questions/576 ... -is-opened
https://superuser.com/questions/1330350 ... ens-a-file
Code: Select all
hWnd=FindWindow_("Progman","Program Manager")
SendMessage_(hWnd,#WM_SETREDRAW,0,0) ; Disable.
OpenFileRequester("", "", "", 0)
SendMessage_(hWnd,#WM_SETREDRAW,1,0) ; Enable.
Thanks for your ideas.BarryG wrote:That's weird cas, because it never happens to my desktops icons. I'm on Win 10 Pro with the latest updates.
BTW, I don't know if disabling the desktop redraw (temporarily) might help?
Note: You might need to change the hWnd to something else, like hWnd=GetDesktopWindow_() or a child window of the hWnd shown in my code.Code: Select all
hWnd=FindWindow_("Progman","Program Manager") SendMessage_(hWnd,#WM_SETREDRAW,0,0) ; Disable. OpenFileRequester("", "", "", 0) SendMessage_(hWnd,#WM_SETREDRAW,1,0) ; Enable.
BTW, a working brute-force fix is to copy a screenshot of your desktop to an image, then show that image in full-screen before opening the dialog. Can't see the icons refresh if the desktop isn't visible (taps forehead). Hehe.
Oops, yes, it will lock the desktop until the file dialog is closed. But you could use OpenFileRequester() in a thread to avoid that.Mischa wrote:Your code freezes full Desktop/App, had to kill purebasic in taskmanager
Well, it's a Windows issue, not a PureBasic bug.Mischa wrote:No, no, i think i can live with this little flaw