1

Is there a way to force a Delphi application to always start on a particular desktop in Windows 10? I'm using multiple desktops, and sometimes switch between them when waiting for the application to compile. This has the effect that when it's finished compiling, the application is launched on the currently active desktop, i.e. not necessarily the "main" one where the IDE is placed.

It would be nice if there was a way to force Delphi to always use the main desktop when launching applications. Or if that's not possible in the IDE, could I at least force the application itself to always use the main desktop?

Note that I'm not talking about multiple monitors, but multiple Windows 10 Desktops.

Magnus
  • 17,157
  • 19
  • 104
  • 189
  • https://stackoverflow.com/q/35942573/505088 you'd need to change the call to CreateProcess. You probably can't do that. – David Heffernan Nov 21 '19 at 07:42
  • 2
    You can call [MoveWindowToDesktop](https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ivirtualdesktopmanager-movewindowtodesktop) method (when the application starts) to move the window to the desktop where is the IDE main window (by [GetWindowDesktopId](https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-ivirtualdesktopmanager-getwindowdesktopid) method, because there is no API for desktop enumeration at this time as far I know). – TLama Nov 21 '19 at 08:45
  • Or better yet would be writing a wizard which would move the window right after application start (but I don't know if there's an OTA notification for main window creation of the executed project binary). – TLama Nov 21 '19 at 09:37

0 Answers0