NetworkAdapterSelector icon indicating copy to clipboard operation
NetworkAdapterSelector copied to clipboard

Unable to use because it renames the Window name.

Open acidreian666 opened this issue 4 years ago • 10 comments

Unable to use because it renames the Window name. please create a parameter that allows you to inject to the specific PID. Without changing the window name with the IP address. It causes compatibility issues for specific programs.

acidreian666 avatar Mar 15 '20 09:03 acidreian666

You can currently attach it to a specific process using PID: https://github.com/falahati/NetworkAdapterSelector#command-line-parameters

However, I need to add a flag to disable the change to the Window's title.

falahati avatar Mar 15 '20 18:03 falahati

If you added the flag it would be greatly appreciated!

acidreian666 avatar Mar 16 '20 12:03 acidreian666

I noticed you added the flag to the the source to allow the main window to not be renamed. but would it be possible to get a released version i don't know how to compile it.

acidreian666 avatar Mar 20 '20 08:03 acidreian666

Fix will be released as part of version 2 that I am writing now in the last couple of days. Hopefully, it will be released soon.

falahati avatar Mar 21 '20 14:03 falahati

Any update Falahati?

acidreian666 avatar Apr 05 '20 05:04 acidreian666

Can you please compile the updated changes for this enhancement? @falahati

acidreian666 avatar Apr 13 '20 12:04 acidreian666

Can you please compile the updated changes for this enhancement? @falahati

The code is not finished yet. Please give him sometime to fix the code.

@falahati I complied it using VSCode and the following error msg will be shown when the programme tried to hook : "The given user library does not export a proper Run...."

It seems that the function "Run" in Guest.cs is not declared correctly (variable for changeWindowTitle is missing). https://github.com/falahati/NetworkAdapterSelector/blob/5e98ad79aeea62f8caac59b9556e6edd9093fbe9/NetworkAdapterSelector.Hook/Guest.cs#L92-L97

The programme can run properly after I added an extra variable in the Run function, but it seems that the flag do not have any effect on stopping the title change.

hobby-lc avatar May 07 '20 04:05 hobby-lc

You are right; it seems that I missed the parameter for the Run method and only added it to the constructor. But adding it should be enough since the logic is already there. You don't need to assign the variable to anything at this stage.

Keep in mind that you also need to execute the program with --title false or --title 0 argument when injecting. And this means that injection by shell extension always has this value as true.

falahati avatar May 07 '20 16:05 falahati

You are right; it seems that I missed the parameter for the Run method and only added it to the constructor. But adding it should be enough since the logic is already there. You don't need to assign the variable to anything at this stage.

Keep in mind that you also need to execute the program with --title false or --title 0 argument when injecting. And this means that injection by shell extension always has this value as true.

@falahati

First of all, I am not familiar with C# programming. My information below may be wrong.

The following code is not working. I run debug in VSCode and it seems that value of ChangeWindowTitle is always "True" no matter what value provided after "--title". https://github.com/falahati/NetworkAdapterSelector/blob/5e98ad79aeea62f8caac59b9556e6edd9093fbe9/NetworkAdapterSelector.Hook/CommandLineOptions.cs#L93

According to the following https://github.com/commandlineparser/commandline/issues/290

Booleans do not take arguments. They are flags, so including the boolean flag means 'true' and leaving it out means 'false'.

With reference to page below: https://stackoverflow.com/questions/35873835/command-line-parser-library-boolean-parameter

I changed the code as follow: public bool? ChangeWindowTitle { get; set; }

And now the argument should take values "true|false". (tested empty or "0" after "--title" is not working)

For your information and Thank you.

hobby-lc avatar May 08 '20 08:05 hobby-lc

Thank you for the report. It happens probably since the flag has a default value of true.

falahati avatar May 08 '20 14:05 falahati