How many more times do you need to have this explained to you before you realise that you are totally out of your depth on this? You have had lots of suggestions as to what you need to do but you obviously don't have the basic knowledge to implement them. I would suggest that you get hold of some books on basic C++ and Windows Programming and work through the sample code to get the understanding and skills you need to solve this problem.
Reposting the same question every day is just getting you more confused.
A service runs in the background, so where are these WM_COMMAND's coming from? You won;t have a menu, or a dialog box...
I think you need to go back to your basics - a service communicates with other programs using various interprocess communcations.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
No, you are writing all your strings into one string, so you will keep only the last one. The problem you have is that you don't know upfront how many directories you will get, so you don't know how large you have to make your array. You could choose the brute force and use an array which is large enough (e.g. char array: max 1024 directories of max 1024 characters). And then in your while loop you keep an index of where to store the current directory name (simply increment it each time).
Is it a C or C++ project ? Because if it is C++, I strongly suggest you to use stl containers (std::list for instance) and std::string, this will avoid to create an array with a fixed size upfront.