<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Open Webbrowser? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/400940#M8647</link>
    <description>&lt;P&gt;thanks &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;im a big fan of the DG::Browser Dialog and i made the whole gui as a browser dialog since i like html a lot better then the DG Framework &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoelBuehler_0-1696496319638.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46828i6D37E5750FDBF0B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoelBuehler_0-1696496319638.png" alt="JoelBuehler_0-1696496319638.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i thought to open a new dialog to show help documents would be unusual behavior since archicad also opens a webbroser for help resources.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Oct 2023 08:59:03 GMT</pubDate>
    <dc:creator>Joel Buehler</dc:creator>
    <dc:date>2023-10-05T08:59:03Z</dc:date>
    <item>
      <title>Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399486#M8614</link>
      <description>&lt;P&gt;Hehey evryone&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i hope my question is not to obvious, but im having trouble to start the webbrowser with a given url from a add-on.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how do i do that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i know so far:&lt;/P&gt;
&lt;P&gt;we can save url documentation data in a element with the calls&lt;/P&gt;
&lt;P&gt;APIDb_SetElementURLRefID&lt;BR /&gt;APIDb_GetElementURLRefID&lt;/P&gt;
&lt;P&gt;and the notification example show how to add and retrieve this url data&lt;/P&gt;
&lt;P&gt;but it does not show how to open that given url...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;we can edit the Add-Ons help URL with the&amp;nbsp;DGRegisterAdditionalHelpLocation, but it also does not show how to open that url... or am i missing something?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 12:56:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399486#M8614</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2024-09-16T12:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399525#M8616</link>
      <description>&lt;P&gt;Not sure if I understand the question correctly, but you can open any url with the default web browser by using the &lt;STRONG&gt;OSUtils::OpenWithDefaultBrowser&lt;/STRONG&gt; call from the &lt;STRONG&gt;DefaultProgramRunner.hpp&lt;/STRONG&gt; header.&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 11:57:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399525#M8616</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2023-09-25T11:57:39Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399530#M8617</link>
      <description>&lt;P&gt;works like a charm! thank you very much!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i recommend to add this to one of the examples.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Sep 2023 12:31:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399530#M8617</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2023-09-25T12:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399638#M8620</link>
      <description>&lt;P&gt;I did something similar few months ago. In general, you can execute any app from within your plugin using&amp;nbsp;&lt;STRONG&gt;ShellExecute()&lt;/STRONG&gt; in Windows and&amp;nbsp;&lt;STRONG&gt;std::system()&lt;/STRONG&gt; for Mac, something like this&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;#if defined (WINDOWS)
		LPCWSTR command = L"https://graphisoft.com";
		ShellExecute(NULL, L"open", command, NULL, NULL, SW_SHOWNORMAL);
#elif defined (macintosh)
		GS::UniString command = "open https://graphisoft.com";
		std::system(command.ToCStr().Get());
#endif&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Sep 2023 08:15:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/399638#M8620</guid>
      <dc:creator>kolioi</dc:creator>
      <dc:date>2023-09-26T08:15:03Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/400910#M8645</link>
      <description>&lt;P&gt;And you can also show a webpage inside your dialog by adding a &lt;FONT face="courier new,courier"&gt;DG::Browser&lt;/FONT&gt; dialog item and loading the URL by calling the &lt;FONT face="courier new,courier"&gt;LoadURL (const GS::UniString&amp;amp; url)&lt;/FONT&gt; member function.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 07:16:45 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/400910#M8645</guid>
      <dc:creator>Miklos Vegh</dc:creator>
      <dc:date>2023-10-05T07:16:45Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/400940#M8647</link>
      <description>&lt;P&gt;thanks &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;im a big fan of the DG::Browser Dialog and i made the whole gui as a browser dialog since i like html a lot better then the DG Framework &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoelBuehler_0-1696496319638.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/46828i6D37E5750FDBF0B4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoelBuehler_0-1696496319638.png" alt="JoelBuehler_0-1696496319638.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i thought to open a new dialog to show help documents would be unusual behavior since archicad also opens a webbroser for help resources.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Oct 2023 08:59:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/400940#M8647</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2023-10-05T08:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/573780#M8815</link>
      <description>&lt;P&gt;Hi Joel, in your pluggin do you open a local HTML file or an outside webpage on the browser?&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 17:06:28 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/573780#M8815</guid>
      <dc:creator>Jorge M</dc:creator>
      <dc:date>2023-11-02T17:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/574099#M8826</link>
      <description>&lt;P&gt;im hosting the html on a subdomain.&lt;/P&gt;
&lt;P&gt;with the html.LoadHTML(htmlstring) method you can load local html, waht is very cool. but i was never able to have a html file and feed this to the ressources compiler tool. =(&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i developed the following hacks:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1. you can have your html in the "AddOnFix.grc". like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoelBuehler_0-1699170947917.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/48452iE7E3653A18392DD8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoelBuehler_0-1699170947917.png" alt="JoelBuehler_0-1699170947917.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;this html can you then call with somethink like this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoelBuehler_1-1699170997580.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/48453i6CC1119A26BB78CB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoelBuehler_1-1699170997580.png" alt="JoelBuehler_1-1699170997580.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. you can have your html directly in your code and consume it with the LoadHTML function. something like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JoelBuehler_2-1699171469450.png" style="width: 400px;"&gt;&lt;img src="https://community.graphisoft.com/t5/image/serverpage/image-id/48454i148AA08571C75DAE/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JoelBuehler_2-1699171469450.png" alt="JoelBuehler_2-1699171469450.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Nov 2023 08:04:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/574099#M8826</guid>
      <dc:creator>Joel Buehler</dc:creator>
      <dc:date>2023-11-05T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/574478#M8830</link>
      <description>&lt;P&gt;You can add a html file as a resource by adding it as a DATA resource. For example:&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;'DATA' 2024 "HTML Resource" {
	"BrowserContent.html"
}
&lt;/LI-CODE&gt;
&lt;P&gt;The resource can be loaded like this (I did not compile it):&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;GS::UniString htmlStr;
GSHandle resHandle = RSLoadResource ('DATA', resModule, 2024);
if (resHandle != nullptr) {
	USize hdlSize = BMGetHandleSize (resHandle);
	const char* p = (const char*) *resHandle;
	htmlStr = GS::UniString (p, hdlSize);
	BMKillHandle (&amp;amp;resHandle);
}
&lt;/LI-CODE&gt;
&lt;P&gt;The loaded resource data does not contain a terminating zero, so a length is needed to the UniString constructor.&lt;/P&gt;
&lt;P&gt;The string can then be loaded to a browser control.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 17:31:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/574478#M8830</guid>
      <dc:creator>Miklos Vegh</dc:creator>
      <dc:date>2023-11-07T17:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Open Webbrowser?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/574499#M8831</link>
      <description>&lt;P&gt;Also, you can check the Browser_Control example Add-On in the Development Kit. It's a full example of using a browser control, and storing a html file as a resource.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Nov 2023 19:00:55 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/Open-Webbrowser/m-p/574499#M8831</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2023-11-07T19:00:55Z</dc:date>
    </item>
  </channel>
</rss>

