Hi everyone,
I have my application that works into SAP BusinessOne
To open my windows into SAP MDI I get SAP MDI handle's and set this as parent to my windows using windows api SetParent
I don't know why but some windows open without issue others don't show, powerbuilder function Open works but window is not visible.
I'm using PowerBuilder 2022 R3 3289 on Windows 2019 Server 64bit, 64bit environment
If I use my application builded with PowerBuilder R2 build 2819 I don't have this issue.
Any suggestions?
Thanks
-----------------------------------------------------------------------------------------------------------
Window open event
long ll_rc
long ll_hPBWindow
long ll_parent_handle
ll_parent_handle = wf_get_handle_sap(string(gole_sbo_application.Desktop.Title))
ll_hPBWindow = handle(This)
ll_rc = SetParent( ll_hPBWindow, ll_parent_handle)
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Function to get SAP MDI handle's wf_get_handle_sap(string as_windowname)
Constant long GW_HWNDFIRST = 0
Constant long GW_HWNDLAST = 1
Constant long GW_HWNDNEXT = 2
Constant long GW_HWNDPREV = 3
Constant long GW_OWNER = 4
Constant long GW_CHILD = 5
Constant long GW_MAX = 5
Constant long MAX_WIDTH = 1255
long ll_hFrameWindow
long ll_hParentWindow
long ll_Desktop
long ll_Child
String ls_WindowName
String ls_ClassName
String ls_ieopened
SetNull( ls_WindowName )
ll_hFrameWindow = FindWindowA( 'TMFrameClass', as_windowname)
ll_Child = GetWindow( ll_hFrameWindow, GW_CHILD )
DO WHILE (ll_Child > 0)
ls_ClassName = Space(MAX_WIDTH)
ls_WindowName = Space(MAX_WIDTH)
GetClassNameW( ll_Child, ls_ClassName, MAX_WIDTH )
GetWindowTextW( ll_Child, ls_WindowName, MAX_WIDTH )
IF ls_classname = 'TMMDIClientClass' and IsWindowVisible(ll_Child) THEN
Return ll_Child
END IF
ll_Child = GetWindow( ll_Child, GW_HWNDNEXT )
LOOP
Return ll_Child
------------------------------------------------------------------------------------------------------------
since your script is in open event of your window, what does Handle(parent) return? Try Handle(this) to get the handle of your current window. Did you move this code from some other control on your window (eg. commandbutton) to the open event?
Best regards
Marc
It's my fault, I have moved script from open event in commandbutton clicked event.