0Day Forums
Is there Path Edit Control in Win32? - Printable Version

+- 0Day Forums (https://0day.red)
+-- Forum: Coding (https://0day.red/Forum-Coding)
+--- Forum: C & C++ (https://0day.red/Forum-C-C)
+--- Thread: Is there Path Edit Control in Win32? (/Thread-Is-there-Path-Edit-Control-in-Win32)



Is there Path Edit Control in Win32? - Promillimeters935 - 07-27-2023

I would like to add an edit box (or is it a combo box?) for entering a file-path using Visual C Win32 so that it offers auto-complete - the same as when you type in Windows Explorer's address bar.

Is there a common control or property I'm missing that allows me to do that?


RE: Is there Path Edit Control in Win32? - joeogtrykl - 07-27-2023

You can use the standard edit control and call [`SHAutoComplete`][1]. Like this:

SHAutoComplete(editWnd, SHACF_DEFAULT);

The system will do the rest for you.


[1]:

[To see links please register here]




RE: Is there Path Edit Control in Win32? - pazit606 - 07-27-2023

There is no Common Control for that. What you can do, however, is use a standard Edit control and attach the [IAutoComplete][1] interface to it, which can be configured to use the file system (amongst other things) as a source for getting string values from. The easiest way to do that is to call the [SHAutoComplete][2] function.

[1]: msdn.microsoft.com/en-us/library/bb776292.aspx
[2]: msdn.microsoft.com/en-us/library/bb759862.aspx