-
?? How do I close another application that has a modal dialog open ??
I have an application that will shut down all instances of another specific
application ( ie. like Word). But it has problems if the application has a
modal dialog window open.
I have tried getting the handle to the dialog box and setting it to the
active window and then using sendkeys() to close the dialog window. I am
not to happy with this method.
Is there an API call that I can make to close the the window or even send it
a message like ID_CANCEL or ID_OK ???
Thanx
Milos
-
Re: ?? How do I close another application that has a modal dialog open ??
Try to use the PostMesage method.
'Get DAP hwnd
DAPhWnd = FindWindow("DAP Class", "Download Accelerator Plus - DAP")
If DAPhWnd Then
PostMessage DAPhWnd, WM_CLOSE, 0, 0
End If
-
Re: ?? How do I close another application that has a modal dialog open ??
Try to use the PostMesage method.
'Get DAP hwnd
DAPhWnd = FindWindow("DAP Class", "Download Accelerator Plus - DAP")
If DAPhWnd Then
PostMessage DAPhWnd, WM_CLOSE, 0, 0
End If
-
Re: ?? How do I close another application that has a modal dialog open ??
Thanx But,
That is the method that I am using to close the application but the
application will not close if it has a modal dialog window open, like an
error message.
Necator <necator@ladnet.cjb.net> wrote in message
news:3a6990bb$1@news.devx.com...
>
> Try to use the PostMesage method.
>
>
> 'Get DAP hwnd
> DAPhWnd = FindWindow("DAP Class", "Download Accelerator Plus - DAP")
> If DAPhWnd Then
> PostMessage DAPhWnd, WM_CLOSE, 0, 0
> End If
>
-
Re: ?? How do I close another application that has a modal dialog open ??
Thanx But,
That is the method that I am using to close the application but the
application will not close if it has a modal dialog window open, like an
error message.
Necator <necator@ladnet.cjb.net> wrote in message
news:3a6990bb$1@news.devx.com...
>
> Try to use the PostMesage method.
>
>
> 'Get DAP hwnd
> DAPhWnd = FindWindow("DAP Class", "Download Accelerator Plus - DAP")
> If DAPhWnd Then
> PostMessage DAPhWnd, WM_CLOSE, 0, 0
> End If
>
-
Re: ?? How do I close another application that has a modal dialog open ??
Hi,
There is example code on www.msdn.microsoft.com. It uses the
TerminateProcess API (search on TerminateProcess to find the specific code)
Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, _
ByVal uExitCode As Long) As Long
--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com/vbpgser.
-
Re: ?? How do I close another application that has a modal dialog open ??
Hi,
There is example code on www.msdn.microsoft.com. It uses the
TerminateProcess API (search on TerminateProcess to find the specific code)
Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, _
ByVal uExitCode As Long) As Long
--
Richard Grier (Microsoft Visual Basic MVP)
Hard & Software
12962 West Louisiana Avenue
Lakewood, CO 80228
303-986-2179 (voice)
303-986-3143 (fax)
Author of Visual Basic Programmer's Guide to Serial Communications, 2nd
Edition ISBN 1-890422-25-8 (355 pages).
For information look on my homepage at http://www.hardandsoftware.net.
Use the Books link to order. For faster service contact the publisher at
http://www.mabry.com/vbpgser.
-
Re: ?? How do I close another application that has a modal dialog open ??
Hello!
You must close this modal window first.
Here is an example: http://smsoft.chat.ru/en/shutdown.htm
--
Sergey Merzlikin
http://smsoft.chat.ru
smsoft@chat.ru
"MilOs" <milosk@hella.net> wrote in message news:3a68b075$1@news.devx.com...
> I have an application that will shut down all instances of another
specific
> application ( ie. like Word). But it has problems if the application has
a
> modal dialog window open.
>
> I have tried getting the handle to the dialog box and setting it to the
> active window and then using sendkeys() to close the dialog window. I am
> not to happy with this method.
>
> Is there an API call that I can make to close the the window or even send
it
> a message like ID_CANCEL or ID_OK ???
>
>
> Thanx
>
>
> Milos
>
>
>
-
Re: ?? How do I close another application that has a modal dialog open ??
Hello!
You must close this modal window first.
Here is an example: http://smsoft.chat.ru/en/shutdown.htm
--
Sergey Merzlikin
http://smsoft.chat.ru
smsoft@chat.ru
"MilOs" <milosk@hella.net> wrote in message news:3a68b075$1@news.devx.com...
> I have an application that will shut down all instances of another
specific
> application ( ie. like Word). But it has problems if the application has
a
> modal dialog window open.
>
> I have tried getting the handle to the dialog box and setting it to the
> active window and then using sendkeys() to close the dialog window. I am
> not to happy with this method.
>
> Is there an API call that I can make to close the the window or even send
it
> a message like ID_CANCEL or ID_OK ???
>
>
> Thanx
>
>
> Milos
>
>
>
-
Re: ?? How do I close another application that has a modal dialog open ??
This is just an idea, but could you send the query unload message. Im not
sure of the specifics
--
Dean Earley (dean.earley@icode.co.uk)
Assistant Developer
iCode Systems
"MilOs" <milosk@hella.net> wrote in message news:3a68b075$1@news.devx.com...
> I have an application that will shut down all instances of another
specific
> application ( ie. like Word). But it has problems if the application has
a
> modal dialog window open.
>
> I have tried getting the handle to the dialog box and setting it to the
> active window and then using sendkeys() to close the dialog window. I am
> not to happy with this method.
>
> Is there an API call that I can make to close the the window or even send
it
> a message like ID_CANCEL or ID_OK ???
>
>
> Thanx
>
>
> Milos
>
>
>
-
Re: ?? How do I close another application that has a modal dialog open ??
This is just an idea, but could you send the query unload message. Im not
sure of the specifics
--
Dean Earley (dean.earley@icode.co.uk)
Assistant Developer
iCode Systems
"MilOs" <milosk@hella.net> wrote in message news:3a68b075$1@news.devx.com...
> I have an application that will shut down all instances of another
specific
> application ( ie. like Word). But it has problems if the application has
a
> modal dialog window open.
>
> I have tried getting the handle to the dialog box and setting it to the
> active window and then using sendkeys() to close the dialog window. I am
> not to happy with this method.
>
> Is there an API call that I can make to close the the window or even send
it
> a message like ID_CANCEL or ID_OK ???
>
>
> Thanx
>
>
> Milos
>
>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks