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 […]

PowerBuilder, different DD list values for each row

Source http://www.pbdr.com/pbtips/dw/fltrdddw.htm Step 1 – declare instance variables boolean ib_dropdowndropped = False boolean ib_dropdownredrawn = True Step 2 – extend the pbm_dropdown event ib_dropdowndropped = True ib_dropdownredrawn = False of_Filter(True) ib_dropdownredrawn = True Step 3 – extend the pbm_ncpaint event If (ib_dropdowndropped And ib_dropdownredrawn) Then ib_dropdowndropped = False ib_dropdownredrawn = False of_Filter(False) ib_dropdownredrawn = True End […]

Calling .NET from PowerBuilder

To call .NET for PowerBuilder best option is to create Class Library in Visual Studio. Sign it. In project properties, Application, Assembly Information…, check “Make assembly COM-Visible”. Sign it class library (project properties, Signing…). In project properties, Application, Assembly Information…, check “Make assembly COM-Visible”. Optional, add these attributes to your class: [ComVisible(true)] [ClassInterface(ClassInterfaceType.AutoDual)] [ProgId(“ClassLibrary1.Class1”)] Register […]

PowerBuilder and Norwegian/Finish/Serbian string to date conversion on Windows 10

Problem: Problem is in system locale on Windows 10. In Windows 10 Microsoft changed date time formats for some regions: Finnish, Norwegian Bokmål (“Norway” and “Svalbard and Jan Mayen” variants), Serbian (variants “Cyrillic, Kosovo”, “Latin, Montenegro”, “Latin, Serbia” and “Latin, Kosovo”). It was internally changed so that it has now the same separator in date […]