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 handlell_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 )