azrael_11 0 Posted October 4, 2023 How can i take a list of opened Delphi IDE and which one is the active when i do a double click in a .pas file? Share this post Link to post
PeterBelow 238 Posted October 4, 2023 If you double-click on a file in Windows Explorer that is the active application, so if you have more than one Delphi instance running none of them is active and which one is handed the file probably depends on which one the BDSLauncher app registered as "server" for .pas files finds first. You have no control over that, so do not open the file by double-click, drag it to the IDE instance you want to use to open it. Share this post Link to post
azrael_11 0 Posted October 4, 2023 8 hours ago, PeterBelow said: If you double-click on a file in Windows Explorer that is the active application, so if you have more than one Delphi instance running none of them is active and which one is handed the file probably depends on which one the BDSLauncher app registered as "server" for .pas files finds first. You have no control over that, so do not open the file by double-click, drag it to the IDE instance you want to use to open it. The main reason to seek which Delphi IDE have the "control" to open files is not the double clicking. Is that when i am inside the project i made when i open a form then i get the class name and make with a key compination like ctrl+F1 to open the .pas file of the form. But when i have two Delphi IDEs open i cant sent it to open in the specific IDE to open instead that it opens in the last instance of Delphi IDE. Is there anyway to open this file at runtime from the specific Delphi IDE that i want and not the last one that opens? Thank you. Share this post Link to post
Pat Foley 51 Posted October 4, 2023 (edited) 32 minutes ago, azrael_11 said: s there anyway to open this file at runtime from the specific Delphi IDE that i want and not the last one that opens? Sure. Go to the IDE you want the file loaded to and give last focus to it then do your double click business. Most users would want IDE last worked in to get incoming files. Note not tested across Desktops! Edited October 5, 2023 by Pat Foley oops works with 11 readily with DDE patch Share this post Link to post
azrael_11 0 Posted October 5, 2023 7 hours ago, Pat Foley said: Sure. Go to the IDE you want the file loaded to and give last focus to it then do your double click business. Most users would want IDE last worked in to get incoming files. Note not tested across Desktops! Maybe misunderstood what i write or i write completely wrong. Let me be more specific. function Tfrm_custom_debug_info.RunCommand(Command: String): Boolean; var full: string; begin full := '/C '+ Command; ShellExecute(0, nil, 'cmd.exe', PChar(full) , nil, SW_HIDE); Self.Close; end; I have this function in my code. the command which is string is the full path of a .pas file. when the program is in runtime and run this function the .pas file opens in the last Delphi IDE i open. What i want to do here is. Get a list of all DELPHI IDE that running Somehow when i execute the function above open the .pas file in the DELPHI IDE i want choose from the list i get above. I think now be more specific. Thank you Share this post Link to post
Pat Foley 51 Posted October 5, 2023 I was thinking about Fixing BDSLauncher topic I followed this topic and my launcher started working. I was just saying the last IDE worked in should the one getting the file. Share this post Link to post
PeterBelow 238 Posted October 5, 2023 8 hours ago, azrael_11 said: The main reason to seek which Delphi IDE have the "control" to open files is not the double clicking. Is that when i am inside the project i made when i open a form then i get the class name and make with a key compination like ctrl+F1 to open the .pas file of the form. But when i have two Delphi IDEs open i cant sent it to open in the specific IDE to open instead that it opens in the last instance of Delphi IDE. Is there anyway to open this file at runtime from the specific Delphi IDE that i want and not the last one that opens? Thank you. Is this project of your's a IDE add-on (wizard or such)? If it is implemented in a design-time package you can use the Open Tools API to open a file instead of leaving the task to Explorer. Share this post Link to post
aehimself 396 Posted October 7, 2023 On 10/5/2023 at 1:36 AM, azrael_11 said: The main reason to seek which Delphi IDE have the "control" to open files is not the double clicking. Is that when i am inside the project i made when i open a form then i get the class name and make with a key compination like ctrl+F1 to open the .pas file of the form. But when i have two Delphi IDEs open i cant sent it to open in the specific IDE to open instead that it opens in the last instance of Delphi IDE. Is there anyway to open this file at runtime from the specific Delphi IDE that i want and not the last one that opens? Thank you. You can discover installed Delphi versions, list their running instances (or start a new one) and instruct them to open a file via TAEDelphiVersions. This is exactly what my configurable BDSLauncher is based on, maybe that one will fit your needs without any extra coding. Share this post Link to post