Solved

Killing EXCEL Process from within Powerbuilder

Posted on 2003-11-12
4
1,460 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
edit html 3 141
Refresh JTable Content 6 211
Android Studio - Gradle project sync failed 5 3,506
Re-running SolarQube failed. “Unable to create root temp directory” 6 106
In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

830 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