prabha_friend, you cannot sort a folder unless the folder is on-screen - because what you see in the query is like a query or like a datasheet view of a table. Sorting is for the gui presentation, not for the underlying data. If the folder is not presented to a gui, there IS no sort operation to be performed. Directories have a fixed order and you don't change that order when you sort by a particular column.
Having said that, the first thing you would need to know is the handle of the window that you wanted to sort. Since window handles are allocated and released, there is no such thing as a permanent handle, so you would need to find the window, then determine its handle, then work with window presentation. However, since there is a perfectly good GUI to do this, the sorting features will be questionable.
IF they exist at all, you would need to look up the COM interface for Windows Explorer, since THAT is the GUI you will have to control.