programmatically close WTSSendMessage dialog box

Hi,
I am launching one UI dialog box using WTSSendMessage in a windows service. I want to close this dialog box programmatically.
Can we programmatically close the dialog box that is created by the WTSSendMessage api function from a windows service on windows 7?

Thanks,
Srinivas
SPATNAIKAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
sarabandeConnect With a Mentor Commented:
if your service runs at the same machine you could close any dialogbox where you have a handle from by a PostMessage call, posting a WM_CLOSE message. you could retrieve the windows handle of the dialog box either by FindWindow or EnumWindows api.

if you sent the message from a remote service you could use the timeout argument of WTSSendMessage to close the window after a timeout.

Sara
0
All Courses

From novice to tech pro — start learning today.