Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: PowerBuilder
Expertise: Beginner
May 2, 1999



Application Security Testing: An Integral Part of DevOps

Bringing another application to the foreground

How can I bring an open application to the foreground (that is, move the PowerBuilder app back a layer).

To bring another application to the front, you will need to use some API calls. Create a user object in PowerBuilder and define the following API calls:

function long FindWindowA( string lpClass, string lpTitle ) library 'user32'
function long SetFocus( long hdWnd ) library 'user32'
subroutine BringWindowToTop( long hdWind ) Library "user32"
Then you will need to call the findWindowA API call to get a handle to the window you want to bring to the front. For example:
// Check for the PB handle
ll_PBHandle = FindWindowA( ls_NULL, 'PBBrowse' )
Then once we have the handle, we can bring the window to the front with the other API calls:
BringWindowToTop( ll_PBHandle )
SetFocus( ll_PBHandle )
DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date