|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
why cant i enumerate shell windows in a windows serviceHi,
Im writing a windows service in C# and I get the following error when trying to enumerate all shellwindows "COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not valid or not registered." What could be the problem?? Any solutions?? Regards, M i s b a h A r e f i n ..NET Programmer En Pointe Technologies Reply to : mare***@enpointe.com www.enpointe.com I even tried cerating a process with CreateProcessWithLogon and
CreateProcessWithToken but still i cannot enumerate shell windows... need help fast guys Show quote "Misbah Arefin" wrote: > Hi, > Im writing a windows service in C# and I get the following error when trying > to enumerate all shellwindows > > "COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is either not > valid or not registered." > > What could be the problem?? Any solutions?? > > > > Regards, > > M i s b a h A r e f i n > .NET Programmer > En Pointe Technologies > Reply to : mare***@enpointe.com > www.enpointe.com > > Misbah Arefin wrote:
> I even tried cerating a process with CreateProcessWithLogon and A service runs under a user other than the interactive user. If you want the > CreateProcessWithToken but still i cannot enumerate shell windows... > need help fast guys > >> Hi, >> Im writing a windows service in C# and I get the following error >> when trying to enumerate all shellwindows >> >> "COM object with CLSID {9BA05972-F6A8-11CF-A442-00A0C90A8F39} is >> either not valid or not registered." >> >> What could be the problem?? Any solutions?? service to get access to the interactive user's desktop then you usually should not write a service. Let me reiterate: windows services are not supposed to have user interfaces, nor interact with the user desktop. You get that error because you are not running the service under a user account. What account are you using? If you want to do any interaction with the visible desktop you should write *two* processes. The service and a process that runs on the user's desktop. The two should talk using some inter process communication. The second process can have the code to access the user's desktop and then communicate that data to the service. Richard |
|||||||||||||||||||||||