Solved

Killing EXCEL Process from within Powerbuilder

Posted on 2003-11-12
4
1,421 Views
Last Modified: 2013-12-26
I am currently launching an asynchronous process from within powerbuilder that is used to generate Excel Reports.  Currently I only allow one report to be ran at a time, however doing it from within an asynchronous process allows the user to continue to use the rest of the application(the main reason I used the asynchronous process was so that the application was not locked up waiting for the report to finish).  I am running into a problem when excel fails to finish the report.  I need to be able to find and kill the exccel process before i can move on.  I am currently pndering creating an entirely new dll written in VB to handle all report generation.  However if anyone could give me some tips as to how i can find and kill the excel process from within powerbuilder that would be a great help, even if i have to create a dll in c++ to do this, that would be acceptable.  thanks for the help in advance.
0
Comment
Question by:smgillis
4 Comments
 

Expert Comment

by:KosmoKramer
ID: 9798174
tries with this API function:

//to find
FUNCTION ulong FindWindowA (REF string classname, REF string WindowName) LIBRARY "user32.dll"
ls_name="Excel Window name"
null(lul_class)
lul_handle = FindWindowA(lul_class, ls_name)

//to kill
FUNCTION boolean PostMessageA(ulong hwndle,UINT wmsg,ulong wParam,ulong lParam) Library "User32.dll"

UInt lui_quit = 18
PostMessageA(Flul_handle, lui_quit, 0, 0);

0
 
LVL 5

Accepted Solution

by:
gafoor78 earned 45 total points
ID: 9830130
hi smgillis

this link contains full code in PB to find and terminate a  process with API

http://www.pbdr.com/software/comp/createpr.zip

rgrds
gafoor
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org (http://seleniumhq.org) Go to that link and select download selenium in the right hand columnThat will then direct you to their downlo…
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

758 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

24 Experts available now in Live!

Get 1:1 Help Now