how to check the focused item on desktop using c#

Dineshkumar.S 456 Reputation points
2022-07-21T10:04:00.9+00:00

can anyone have logic to share ??

Developer technologies | C#
Developer technologies | C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
{count} vote

Answer accepted by question author
  1. Castorix31 91,506 Reputation points
    2022-07-21T10:32:03.117+00:00

    You can see in the declarations of interfaces (from code posted in the other thread) that there is GetFocusedItem in IFolderView

             int nIndex = 0;  
             hr = pFolderView.GetFocusedItem(ref nIndex);  
    

    then you can get pidlItem from nIndex and get properties of the item such GetDisplayNameOf like in the loop

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.