Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Killing EXCEL Process from within Powerbuilder

Posted on 2003-11-12
4
Medium Priority
?
1,532 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 180 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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.
Suggested Courses

715 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