MainWindowTitle returns empty string

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Environment: FW 1.x VB.net

When making a call to MainWindowTitle from a windows service an empty string
is returned. All of the application processes being checked have UI with
titles. If I run the same code from a test windows application,
MainWindowTitle returns a value. Is there an issue with calling
MainWindowTitle from a windows service? The code is able to see the process,
but just unable to retrieve the MainWindowTitle.

Thanks for the help...
 
Environment: FW 1.x VB.net

When making a call to MainWindowTitle from a windows service an empty string
is returned. All of the application processes being checked have UI with
titles. If I run the same code from a test windows application,
MainWindowTitle returns a value. Is there an issue with calling
MainWindowTitle from a windows service? The code is able to see the process,
but just unable to retrieve the MainWindowTitle.

Windows Services don't usually have a UI. They are a background process
with no user interaction. No UI means no MainWindowTitle.
 
Patrick:

I think you misunderstood my question. My service is trying to pickup the
MainWindowTitle of other processes running on the server. I found a post
(elsewhere) that said to check the "Allow service to interact with desktop"
checkbox; howerver, my service is running under a user account and not the
Local System Account. Does anyone know of a way around this?
 
I think you misunderstood my question. My service is trying to pickup the
MainWindowTitle of other processes running on the server. I found a post
(elsewhere) that said to check the "Allow service to interact with desktop"
checkbox; howerver, my service is running under a user account and not the
Local System Account. Does anyone know of a way around this?

Out of curiosity, does the MainWindowHandle return something other than
IntPtr.Zero?
 
Back
Top