Solved

programmatically close WTSSendMessage dialog box

Posted on 2013-05-15
3
887 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 32

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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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 start your Windows 10 PC and got an "Operating system not found" error or just saw  "Auto repair for startup". After a while, you have entered a loop for Auto repair which does not fix anything and you will be in a  panic as all your work w…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
This Micro Tutorial will teach you the basics of configuring your computer to improve its speed. It will also teach you how to disable programs that are running in the background simultaneously. This will be demonstrated using Windows 7 operating…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now