Closed JustArion closed 1 year ago
Very great! I have also been thinking about this. Have you tried whether you can start it with command line arguments and still get the output text in the command prompt you have started it in, meaning that no additional command prompt launches, where you can only shortly see the text output? Because this is the reason why I chose to make it a console application, but if this is not an issue (anymore), I can merge it.
I haven't tested with command line arguments yet, but I have tested baseline functionality for Debug and Release modes and they work fine. I'll update the reply with an answer in a few minutes if an additional console is spawned or not.
Edit: No additional console is spawned. It attaches to the parent and sets the output to the parent instance perfectly fine. Text is also output successfully to the parent (if any) or in the case that there is no parent, text is successfully output to the newly created console.
I have just noticed that the change is for the injector and not the GUI, so there are no command line options anyway. This is good.
This PR inverts the ChromeDllInjector Console Logic by Creating a Console via
Kernel32.AllocConsole();
instead of Destroying the current Console session if the build is not Debug.Why though?
When the program runs on Startup the Console is briefly seen which is unnecessary.
What's Changed?
Kernel32.FreeConsole();
Kernel32.AllocConsole();