{"id":792,"date":"2011-06-23T20:20:12","date_gmt":"2011-06-24T01:20:12","guid":{"rendered":"http:\/\/anvil-of-time.com\/wordpress\/?p=792"},"modified":"2021-03-10T20:33:24","modified_gmt":"2021-03-11T01:33:24","slug":"powerbuilder-folder-selection-dialog-window","status":"publish","type":"post","link":"https:\/\/anvil-of-time.com\/powerbuilder\/powerbuilder-folder-selection-dialog-window\/","title":{"rendered":"PowerBuilder &#8211; Folder Selection Dialog Window"},"content":{"rendered":"<p>Here is an NVO used to envoke a Windows folder selection dialog since PowerBuilder does not have it&#8217;s own version. You can change the API calls to ANSI for earlier versions of PB. I&#8217;ve had this squirreled away for awhile and I no doubt got it from someone else off the web. Thanks!<\/p>\n<pre name=\"code\" class=\"VB\">\/\/ window event script with string parameter\n\/\/ string parameter is the caption on the folder selection dialog window\n\nuo_select_folder luo_folder\n\/\/ iw_parent set somewhere else on the window\nRETURN luo_folder.uf_browseforfolder( iw_parent, as_caption)<\/pre>\n<p>Export for non visual object. Uses Unicode API calls.<\/p>\n<pre name=\"code\" class=\"VB\">$PBExportHeader$uo_select_folder.sru\nforward\nglobal type uo_select_folder from nonvisualobject\nend type\ntype str_itemid from structure within uo_select_folder\nend type\ntype str_itemidlist from structure within uo_select_folder\nend type\ntype str_browseinfo from structure within uo_select_folder\nend type\nend forward\n\ntype str_itemid from structure\n\tunsignedint\t\tdb\n\tcharacter\t\tabid\nend type\n\ntype str_itemidlist from structure\n\tstr_itemid\t\tmkid\nend type\n\ntype str_browseinfo from structure\n\tunsignedlong\t\thowner\n\tunsignedlong\t\tpidlroot\n\tstring\t\tpszdisplayname\n\tstring\t\tlpsztitle\n\tunsignedinteger\t\tulflags\n\tunsignedlong\t\tlpfn\n\tlong\t\tlparm\n\tinteger\t\tiimage\nend type\n\nglobal type uo_select_folder from nonvisualobject autoinstantiate\nend type\n\ntype prototypes\n Function unsignedlong SHGetPathFromIDListW( unsignedlong pidl, ref string pszPath) Library &#039;shell32&#039;\nFunction unsignedlong SHBrowseForFolderW( str_browseinfo lpstr_browseinfo ) Library &#039;shell32&#039;\nSubroutine CoTaskMemFree( ulong idlist ) Library &#039;ole32&#039;\nend prototypes\nforward prototypes\npublic function string uf_browseforfolder (ref window awi_parent, string as_caption)\nend prototypes\n\npublic function string uf_browseforfolder (ref window awi_parent, string as_caption);str_browseinfo lstr_bi\nstr_itemidlist lstr_idl\nunsignedlong ll_pidl\nunsignedlong ll_r\nInteger li_pos\nString ls_Path\nunsignedlong ll_Null\n\nSetNull( ll_Null )\n\nlstr_bi.hOwner = Handle( awi_Parent )\nlstr_bi.pidlRoot = 0\nlstr_bi.lpszTitle = as_caption\nlstr_bi.ulFlags = 1\nlstr_bi.pszDisplayName = Space( 255 )\nlstr_bi.lpfn = ll_Null\n\nll_pidl = SHBrowseForFolderW( lstr_bi )\n\nls_Path = Space( 255 )\nll_R = SHGetPathFromIDListW( ll_pidl, ls_Path )\n\nCoTaskMemFree( ll_pidl )\n\nRETURN ls_Path\nend function\n\non uo_select_folder.create\ncall super::create\nTriggerEvent( this, &quot;constructor&quot; )\nend on\n\non uo_select_folder.destroy\nTriggerEvent( this, &quot;destructor&quot; )\ncall super::destroy\nend on<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Here is an NVO used to envoke a Windows folder selection dialog since PowerBuilder does not have it&#8217;s own version. You can change the API calls to ANSI for earlier versions of PB. I&#8217;ve had this squirreled away for awhile and I no doubt got it from someone else off the web. Thanks! \/\/ window&hellip;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3,10],"tags":[12,16,42],"_links":{"self":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/792"}],"collection":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/comments?post=792"}],"version-history":[{"count":4,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/792\/revisions"}],"predecessor-version":[{"id":1960,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/posts\/792\/revisions\/1960"}],"wp:attachment":[{"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/media?parent=792"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/categories?post=792"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anvil-of-time.com\/wp-json\/wp\/v2\/tags?post=792"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}