Solved

programmatically close WTSSendMessage dialog box

Posted on 2013-05-15
3
902 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 34

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

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…
This Micro Tutorial will teach you how to change your appearance and customize your Windows 7 interface to your unique preference. This will be demonstrated using Windows 7 operating system.
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.

756 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