Solved

Killing EXCEL Process from within Powerbuilder

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 132
Aptana 3.6 Preview Problem On Mac 35 115
Eclipse and java version isssue 2 39
Should CArray be used for a list of pointers in C++? 19 97
Here is a helpful source code for C++ Builder programmers that allows you to manage and manipulate HTML content from C++ code, while also handling HTML events like onclick, onmouseover, ... Some objects defined and used in this source include: …
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.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.

896 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

16 Experts available now in Live!

Get 1:1 Help Now