PowerBuilder, disable system menu`s close button

ulong ll_parent_hwnd
ulong ll_sys_menu_hwnd
ulong ll_sys_menu_close_flags
ulong ll_ret

n_cst_numerical u_num

ll_parent_hwnd = Handle(this.parentwindow())

ll_sys_menu_hwnd = GetSystemMenu(ll_parent_hwnd, FALSE)

ll_sys_menu_close_flags = GetMenuState(ll_sys_menu_hwnd, SC_CLOSE, MF_BYCOMMAND )

ll_ret = u_num.of_bitwiseand(ll_sys_menu_close_flags , MF_DISABLED)

ib_close_prev_enabled = (ll_ret = 0)

If ib_close_prev_enabled Then
EnableMenuItem (ll_sys_menu_hwnd, SC_CLOSE, MF_BYCOMMAND + MF_DISABLED + MF_GRAYED)
End If

 

And to enable it later:

If ib_close_prev_enabled Then
EnableMenuItem (GetSystemMenu(handle(parentwindow()), FALSE), SC_CLOSE, MF_BYCOMMAND + MF_ENABLED)
End If

 

PowerBuilder, different DD list values for each row, another way

The Ol’ Hidden Items in the Dddw Problem Part II

Make a second copy of the Color column and have this always contain all the rows in its dddw.  This second column is never filtered.

When the row is not the current row, display the column with the unfiltered dddw and hide the filter column.  If the row is the current row, show the column with the filtered dddw, and hide the column with the dddw with all the possible rows.  To do this, add the following expression to the visibility attribute of the column with the dddw which gets filtered:

IF (CurrentRow() = GetRow(), 1, 0)

The column with the dddw which always contains all the values will have the following expression in its visibility attribute:

IF (CurrentRow() = GetRow(), 0, 1)