简体   繁体   中英

How to programmatically get current directory of a Windows command line or Windows explorer?

I'm writing a Qt C++ program on Windows and it has registered a global shortcut Ctrl+j . Whenever the user press Ctrl+j , the program's UI will show up. When the active window is a Windows command line or a Windows explorer and the user presses Ctrl+j , I want to get the current directory of the Windows command line or a Windows explorer. Is that possible?

For Windows Explorer you can write a BHO and communicate with it from your application. BHO - Browser Helper Object - will load into Windows Explorer process and can access anything, eg windows handles, text in the textboxes etc. We've done this for Internet Explorer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM