Solved

programmatically close WTSSendMessage dialog box

Posted on 2013-05-15
3
899 Views
Last Modified: 2013-06-11
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
0
Comment
Question by:SPATNAIK
3 Comments
 
LVL 33

Accepted Solution

by:
sarabande earned 500 total points
ID: 39168638
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

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Lee
Windows 7 Ultimate and Enterprise (and 2008 R2) introduced a new feature you may not be aware of - Boot from VHD.   Boot from VHD (or what Microsoft refers to asNative Boot allows you to install Windows to a VHD (Virtual Hard Disk) file that is t…
When you try to share a printer , you may receive one of the following error messages. Error message when you use the Add Printer Wizard to share a printer: Windows could not share your printer. Operation could not be completed (Error 0x000006…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
This Micro Tutorial will give you a basic overview of Windows Live Photo Gallery and show you various editing filters and touches to photos you can apply. This will be demonstrated using Windows Live Photo Gallery on Windows 7 operating system.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question