Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


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

Bringing another application to the foreground

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

Answer:
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.

 

 

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