There is a way you can open 3rd party exe like a response window within your PowerBuilder application. Though I am not sure if that will be useful to you as you want to open it like a sheet window. Anyway, the following is the code.
Local External Function Declration:
Function long FindWindowA (long classname, string windowname) LIBRARY "user32.dll" alias for "FindWindowA;Ansi"
Function Boolean BringWindowToTop (long classname) LIBRARY "user32.dll" alias for "BringWindowToTop;Ansi"
Local Function:
public function integer of_manage_third_party_exe ()
public function integer of_manage_third_party_exe ();///////////////////////////////////////////////////////////////////////////////////
//
// Returns 1 - window is not opened
// -1 : A window is opened so bring it to top
//
///////////////////////////////////////////////////////////////////////////////////
long ll_handle //unique id of window opened
ll_handle = FindWindowA(0,"Title of third party exe")
//If the window is not opened Then bring the window to top
If ll_handle > 0 Then
Post BringWindowToTop(ll_handle)
Return -1
End If
Return 1
Script in Activate event of your frame window/the window from which you are going to open the 3rd party exe:
of_manage_third_party_exe()
Script in CloseQuery event:
//if third party exe is open then don't allow to close the window
If of_manage_third_party_exe ( ) < 0 Then
Return 1
End If
I guess it will help you figure out rest of the places where you might have to use the of_manage_third_party_exe function based on your functionality.