I created a tool window as part of VSIX project and installed an extension to test it. So, the tool window need access to the current solution/project opened in visual studio. When the user created the project for the first time, We can fetch the path using DTE object as mentioned in below and I tried them and it works fine,
How can an add-in detect when a solution is loaded?
Acessing currently opened solution in a vsix project
But How to fetch the current solution path next time,when user just double clicks on solution? Right now when user opens the .sln file , the tool window breaks as it couldn't locate the opened solution path.