PeterPanettone 157 Posted November 13, 2023 One thing that has been annoying me for a long time: If you double-click a .DPR file in the File Explorer, it is loaded in the IDE, but the IDE is not brought to the foreground! Can anyone confirm this - and is there a way to fix this problem? Share this post Link to post
dummzeuch 1505 Posted November 13, 2023 Does this happen when the IDE is already open, when it must be started or in both cases? Share this post Link to post
PeterPanettone 157 Posted November 13, 2023 3 minutes ago, dummzeuch said: Does this happen when the IDE is already open It happens when the IDE is already open but in the background (i.e., not in the foreground, not minimized). Share this post Link to post
PeterBelow 238 Posted November 13, 2023 1 hour ago, PeterPanettone said: It happens when the IDE is already open but in the background (i.e., not in the foreground, not minimized). Since several Windows versions an application running in background (= not having the input focus) cannot simply push itself into the foreground anymore because it thinks itself soo much more important than what the user may currently be working with. Instead it flashes its taskbar button to inform the user that it requires its attention. Does that not happen in your scenario? 1 Share this post Link to post
DelphiUdIT 176 Posted November 13, 2023 (edited) That are the documentation for the SetForegroundWindow ... https://learn.microsoft.com/it-it/windows/win32/api/winuser/nf-winuser-setforegroundwindow I think the the link view it in Italian (my language) ... but you can easy make a search in your language. Of course this is for an application, but the IDE is an application so the rules are those. Bye Edited November 13, 2023 by DelphiUdIT Share this post Link to post
PeterPanettone 157 Posted November 13, 2023 1 hour ago, PeterBelow said: Since several Windows versions an application running in background (= not having the input focus) cannot simply push itself into the foreground anymore because it thinks itself soo much more important than what the user may currently be working with. Instead it flashes its taskbar button to inform the user that it requires its attention. Does that not happen in your scenario? No - it seems that someone at Embarcadero is not following the rules. Does it flash when you repeat the described scenario? This is a good example of where stubborn adherence to the rules leads to disadvantages in a smooth workflow. It would be possible to define an exception option in the options. Share this post Link to post
Lars Fosdal 1792 Posted November 13, 2023 What drives me nuts, is the UACs that flashes the icon but doesn't bring the window to front. There are Windows settings that can affect the bring to front behaviour. Also, Windows drivers and layout management tools can affect the behaviour. 1 Share this post Link to post
DelphiUdIT 176 Posted November 13, 2023 I don't think there is a good solution (some hacks surely). But I think the choose of Microsoft is a good solution. If are writing something in your TextWriter I don't think you liked that another application start in foreground (and maybe you write on it causing disaster). When I use an application I really don't desire that another application popup in front .... Share this post Link to post
dummzeuch 1505 Posted November 13, 2023 2 hours ago, PeterBelow said: Since several Windows versions an application running in background (= not having the input focus) cannot simply push itself into the foreground anymore because it thinks itself soo much more important than what the user may currently be working with. Instead it flashes its taskbar button to inform the user that it requires its attention. Hm, in that case the IDE should not be allowed to push itself into the foreground when it hits a breakpoint or catches an exception while debugging a program, when a different program (not the one being debugged) is the foreground window? Share this post Link to post
Pat Foley 51 Posted November 13, 2023 Works for me side by side... Notice how grouping shows a Instance paired with explorer it was paired with Help. I like the Startup layout and set the message and callstack views that popout in debug view. My only complaint is D12 icon same as D11 icon? Share this post Link to post
PeterPanettone 157 Posted November 13, 2023 When you DOUBLE-CLICK a .DPR file it means you really want to load that project in the IDE and work with that project. So, it would be sensible to bring the IDE window to the foreground. Tell me a case where this would not be the case. Share this post Link to post
Anders Melander 1783 Posted November 13, 2023 3 hours ago, dummzeuch said: Hm, in that case the IDE should not be allowed to push itself into the foreground when it hits a breakpoint or catches an exception while debugging a program, when a different program (not the one being debugged) is the foreground window? It makes better sense when you've read the documentation... https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-setforegroundwindow Quote The system restricts which processes can set the foreground window. A process can set the foreground window by calling SetForegroundWindow only if: All of the following conditions are true: The calling process belongs to a desktop application, not a UWP app or a Windows Store app designed for Windows 8 or 8.1. The foreground process has not disabled calls to SetForegroundWindow by a previous call to the LockSetForegroundWindow function. The foreground lock time-out has expired (see SPI_GETFOREGROUNDLOCKTIMEOUT in SystemParametersInfo). No menus are active. Additionally, at least one of the following conditions is true: The calling process is the foreground process. The calling process was started by the foreground process. There is currently no foreground window, and thus no foreground process. The calling process received the last input event. Either the foreground process or the calling process is being debugged. It is possible for a process to be denied the right to set the foreground window even if it meets these conditions. And as is usually the case with things like this, Raymond Chen has words: https://devblogs.microsoft.com/oldnewthing/20090220-00/?p=19083 1 Share this post Link to post
aehimself 396 Posted November 14, 2023 On 11/13/2023 at 12:58 PM, PeterPanettone said: One thing that has been annoying me for a long time: If you double-click a .DPR file in the File Explorer, it is loaded in the IDE, but the IDE is not brought to the foreground! Can anyone confirm this - and is there a way to fix this problem? This bothered me for ages and never could figure out when it opens in the background and when it opens "correctly". What is even more strange I forgot about this behavior when I wrote my BDSLauncher... anyway, now it will attempt to bring the selected instance to the foreground after the file has been opened. Thank you for reminding! Share this post Link to post
Brian Evans 105 Posted November 15, 2023 Delphi 12 is better behaved on the taskbar than previous versions. No extra entries on the task bar for the running IDE - just one taskbar icon for both. Can now use Windows key + number key to both launch or switch to it. Even works to cycle between multiple running copies of the same Delphi 12. (Win+# are shortcuts for the first 10 application icons on the taskbar). Share this post Link to post