Skip to content

Instantly share code, notes, and snippets.

@Memphizzz
Last active December 15, 2020 18:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Memphizzz/ed69d2500c422019609c to your computer and use it in GitHub Desktop.
Save Memphizzz/ed69d2500c422019609c to your computer and use it in GitHub Desktop.
Helpers.ShowFileProperties(sourcePath);
IntPtr ptr = IntPtr.Zero;
var title = IsDirectory(sourcePath) ? new DirectoryInfo(sourcePath).Name : new FileInfo(sourcePath).Name;
title += " Properties";
while (ptr == IntPtr.Zero)
ptr = Helpers.FindWindow("#32770", title);
@kanchanpatil10
Copy link

title matching with FindWindow is working good on english locale but if another locale it fails, do you face same issue on different locale, the Main issue I am facing now, shellexecute is not returning window handle so we need to use findwindow with title matching, which is not working in other locale.
Could you please give me a suggestion if you face same issue

@Memphizzz
Copy link
Author

Memphizzz commented Dec 15, 2020

@kanchanpatil10 Hi, this is a very old gist and I don't know how you found it but in your case wouldn't the SetTitleMatchMode Option work for you and just set it to from beginning instead of exact match? The path should be first in the properties dialogs title so without "Properties" and still keeping the class (#32770), it should match.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment