Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Microsoft store is not closing #21

Closed
Harsh011000 opened this issue Sep 11, 2023 · 1 comment
Closed

Microsoft store is not closing #21

Harsh011000 opened this issue Sep 11, 2023 · 1 comment
Labels
Fixed waiting for reply Awaiting for the reply from issue commiter.

Comments

@Harsh011000
Copy link

Harsh011000 commented Sep 11, 2023

when i open microsoft store using open() method it works but when i try close() method to close microsoft store it show microsoft is not running even if it is running everytime.
it has the same problem with winrar,microsoft to do also

@athrvvvv athrvvvv added waiting for reply Awaiting for the reply from issue commiter. Fixed labels Jan 3, 2024
@athrvvvv
Copy link
Owner

athrvvvv commented Jan 3, 2024

If you add exception manually like this:

from AppOpener import close
import pygetwindow as gw

def close_ms_store():
    try:
        ms_store_windows = gw.getWindowsWithTitle("Microsoft Store")
        if ms_store_windows:
            for window in ms_store_windows:
                if "Microsoft Store" in window.title:
                    window.close()
            print("Microsoft Store closed successfully.")
        else:
            print("Microsoft Store window not found.")
    except Exception as e:
        print(f"Error: {e}")
        
try:
    close("Microsoft Store", throw_error=True)
except:
    close_ms_store()

Note: pip install PyGetWindow

You may make pull request integrating this into AppOpener. If not, don't worry next version will fix this 👍(it will take time, until use above method)

@athrvvvv athrvvvv pinned this issue Jan 3, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Fixed waiting for reply Awaiting for the reply from issue commiter.
Projects
None yet
Development

No branches or pull requests

2 participants