Page 2 of 2
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 2:33 pm
by Blue
What’s your point exactly ? I fail to see how that linked topic relates to the current topic.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 2:43 pm
by AZJIO
You mention that you use the text in the title. I suggest taking the text from the address bar.
The window class is different in different versions of Windows. I don't see a Windows version request in your code.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 2:49 pm
by Blue
Denis wrote: Tue Jul 01, 2025 6:20 am
[…]
firstly - hwin is alway equal to 0, so test 'If hWin is never true.
secondly - I do prefer use API ShellExecute_() instead of RunProgram.
hWin is
expected to be zero if there is no opened Explorer window titled with whatever folder you’re using. On subsequent calls — if the window is still opened of course — hWin will provide the handle for the opened window and move that window to the foreground.
The darn code is so simple that I don’t understand why it won’t work on your machine, especially given that your system and mine are the same. On my machine, it works flawlessly and every time, so I’ll leave it at that. If you ever figure out why it fails on yours, let me know.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 2:56 pm
by AZJIO
SetForegroundWindow_
Try this one:
viewtopic.php?t=7424
Keep in mind that the PureBasic option not only opens the folder, but also highlights the file within it.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 3:16 pm
by Blue
Again, what’s your point exactly?
The tool presented in this topic uses the code you’re referring to to bring the window to the forefront. So what’s there to change ? My code is not worded the same, but it calls upon the same API function.
Apparently, the whole thing fails for you, and you haven’t shown me why and where.
So, keep tinkering with it if you want. For me, it’s just perfect as it is.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 3:26 pm
by Denis
Blue wrote:
hWin is expected to be zero if there is no opened Explorer window titled with whatever folder you’re using. On subsequent calls — if the window is still opened of course — hWin will provide the handle for the opened window and move that window to the foreground.
On my computer it's not the case, hWin is always equal to 0, even with the correct folder is open in Explorer.
bizarre ce comportement avec le même OS
Blue wrote:
The darn code is so simple that I don’t understand why it won’t work on your machine, especially given that your system and mine are the same. On my machine, it works flawlessly and every time, so I’ll leave it at that. If you ever figure out why it fails on yours, let me know.
Ok
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 3:34 pm
by Blue
Merci pour le suivi intéressant.
Je demeure très intéressé et curieux de savoir pourquoi du code correct et fonctionnel sur un système ne fonctionne pas sur un système pratiquement identique. Bizarre de mystère qui m’intrigue.
Malheureux que ça me coûterait si cher de me déplacer jusque chez toi.
Je serais volontiers allé voir ça de plus près.

Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 3:41 pm
by Denis
C'est pas trop le moment de venir en France (même si j'habite dans l'est vers la frontière suisse), les températures sont caniculaires!
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 3:49 pm
by Blue
Si j’en crois ce que raconte la télé, le mot « caniculaires » est faible pour décrire les températures qui vous tombent dessus. Vous vivez ces jours-ci dans un véritable four. Bon courage !
Va vite piquer une tête dans le Lac Léman. C’est beau, c’est frais, et c’est pas tellement loin de chez toi…
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 3:51 pm
by AZJIO
Blue wrote: Tue Jul 01, 2025 3:16 pm
Again, what’s your point exactly?
The SetForegroundWindow_ function gave me an error 9 times out of 10 in the programs I was using. The option I suggested gave me an error 0 times out of 10. Therefore, I permanently switched to the new function.
Denis wrote: Tue Jul 01, 2025 3:41 pm
les températures sont caniculaires!
I googled the temperature in France - 38°, and in Russia-Ural it's 26°. Since the beginning of summer, the temperature has been normal, with a couple of days at 31° and then back to 22-26°.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 4:00 pm
by Denis
AZJIO wrote: Tue Jul 01, 2025 3:51 pm
Denis wrote: Tue Jul 01, 2025 3:41 pm
les températures sont caniculaires!
I googled the temperature in France - 38°, and in Russia-Ural it's 26°. Since the beginning of summer, the temperature has been normal, with a couple of days at 31° and then back to 22-26°.
22-26, These are very good temperatures (I don't really like heat).
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 4:10 pm
by AZJIO
Denis wrote: Tue Jul 01, 2025 4:00 pm
I don't really like heat
I think no one likes the heat. A couple of years ago, we had 36° heat all summer, all the grass was dry, and the fields were yellow. This summer, there's been a lot of rain, and even the cucumbers are growing, even though they need heat. The forecast for July is 23-26°.
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Tue Jul 01, 2025 6:43 pm
by Blue
AZJIO wrote: Tue Jul 01, 2025 4:10 pm
[…]
A couple of years ago, we had 36° heat all summer, all the grass was dry, and the fields were yellow.
[…]
The forecast for July is 23-26°.
At temperatures like that, even people would turn yellow in Montreal (Canada) !
So, where is that ? You mention Russia/Ural before, but that’s a mega large territory. Give me a precise point I can locate on Google Map or Google Earth. Maybe I can even see you ("
Oh, look ! there’s a guy coding in PureBasic down there…")
Re: Opening/Activating current sourcefile folder, even in Windows 11
Posted: Wed Jul 02, 2025 1:34 am
by Olli
In west-France, there is small bled named "Bretagne". Do you know the "french riviera" ? Well, the "Bretagne" (english Britain), it is the "french delugia". Everybody in the hemisphere is feeling the high heats, warned by media to be careful, but in Britain, it rains standing between 18° and 22°.
We had the same recent maxima (28°, 30° and 33°) but it is far shorter than away actually. The nights are often near 17°.
I hope it will stay like that this summer. Not easy, as in 2022, when the nights were hot also...
From here, I think AZJIO lives a little bit further behind Saint-Malo (east part).