{"id":24864,"date":"2017-10-15T12:35:36","date_gmt":"2017-10-15T07:05:36","guid":{"rendered":"https:\/\/www.wikitechy.com\/technology\/?p=24864"},"modified":"2017-10-15T12:35:36","modified_gmt":"2017-10-15T07:05:36","slug":"web-browser-project-c-c-program-open-websiteurl","status":"publish","type":"post","link":"https:\/\/www.wikitechy.com\/technology\/web-browser-project-c-c-program-open-websiteurl\/","title":{"rendered":"Web browser project in c, c program to open a website\/url"},"content":{"rendered":"<p>This program opens a website entered by the user. User can open any website .It will launch Mozilla Firefox web browser to open a website so it should be installed on your computer, if you are using an another web browser then you can change the path in the program.<\/p>\n<h2 id=\"c-programming-code\">C programming code<\/h2>\n<div class=\"code-embed-wrapper\"> <div class=\"code-embed-infos\"> <\/div> <pre class=\"language-c code-embed-pre line-numbers\"  data-start=\"1\" data-line-offset=\"0\"><code class=\"language-c code-embed-code\">#include &lt;stdio.h&gt;<br\/>#include &lt;conio.h&gt;<br\/>#include &lt;stdlib.h&gt;<br\/>#include &lt;graphics.h&gt;<br\/>#include &lt;dos.h&gt;<br\/>#include &lt;string.h&gt;<br\/> <br\/>void initialize_graphics_mode();<br\/>int get_key();<br\/>void draw();<br\/> <br\/>union REGS i, o;<br\/> <br\/>main()<br\/>{<br\/>  int key, i = 0, xpos, ypos, button;<br\/>  char arr[200], temp[5], *ptr;<br\/>  char a[] = &quot;C:\\\\Progra~1\\\\Mozill~1\\\\firefox &quot;;<br\/> <br\/>  strcpy(arr,a);<br\/> <br\/>  i = strlen(a);<br\/> <br\/>  initialize_graphics_mode();<br\/> <br\/>  draw();<br\/> <br\/>  while(1)<br\/>  {<br\/>    if(kbhit())<br\/>      key = get_key();<br\/> <br\/>    if((key&gt;=97&amp;&amp;key&lt;=122)||(key&gt;=65&amp;&amp;key&lt;=90)||key==46||key==47||key==63)<br\/>    {<br\/>      arr[i] = key;<br\/>      sprintf(temp,&quot;%c&quot;,arr[i]);<br\/>      outtext(temp);<br\/>      if(getx()&gt;470)<br\/>      {<br\/>        clearviewport();<br\/>        moveto(5,2);<br\/>      }<br\/>      i++;<br\/>    }<br\/>    else if ( key == 13 )<br\/>    {<br\/>      arr[i] = &#039;\\0&#039;;<br\/>      system(arr);<br\/>      break;<br\/>    }<br\/>    else if ( key == 27 )<br\/>    {<br\/>      closegraph();<br\/>      exit(EXIT_SUCCESS);<br\/>    }<br\/>    if(button==1&amp;&amp;xpos&gt;=150&amp;&amp;xpos&lt;=480&amp;&amp;ypos&gt;=300&amp;&amp;ypos&lt;=330)<br\/>    {<br\/>      system(&quot;C:\\\\Progra~1\\\\Mozill~1\\\\firefox programmingsimplified.com&quot;);<br\/>      break;<br\/>    }<br\/>    key = -1;<br\/>  }<br\/> <br\/>  closegraph();<br\/>  return 0;<br\/>}<br\/> <br\/>void initialize_graphics_mode()<br\/>{<br\/>  int gd = DETECT, gm, errorcode;<br\/> <br\/>  initgraph(&amp;gd,&amp;gm,&quot;C:\\\\TC\\\\BGI&quot;);<br\/>  errorcode = graphresult();<br\/> <br\/>  if( errorcode != grOk )<br\/>  {<br\/>    printf(&quot;Graphics error : %s\\n&quot;,grapherrormsg(errorcode));<br\/> <br\/>    printf(&quot;Press any key to exit...\\n&quot;);<br\/>    getch();<br\/>    exit(EXIT_FAILURE);<br\/>  }<br\/>}<br\/> <br\/>int get_key()<br\/>{<br\/>  i.h.ah = 0;<br\/>  int86(22,&amp;i,&amp;o);<br\/> <br\/>  return( o.h.al );<br\/>}<br\/> <br\/>void draw()<br\/>{<br\/>  settextstyle(SANS_SERIF_FONT,HORIZ_DIR,2);<br\/>  outtextxy(275,11,&quot;Web Browser&quot;);<br\/>  outtextxy(155,451,&quot;&lt;a href=&quot;http:\/\/www.programmingsimplified.com&quot;&quot;&gt;www.programmingsimplified.com&quot;&lt;\/a&gt;);<br\/>  outtextxy(5,105,&quot;Enter URL : &quot;);<br\/>  rectangle(120,100,600,130);<br\/>  setviewport(121,101,599,129,1);<br\/>  moveto(5,1);<br\/>}<\/code><\/pre> <\/div>\n[ad type=&#8221;banner&#8221;]\n","protected":false},"excerpt":{"rendered":"<p>Web browser project in c, c program to open a website\/url &#8211; c programming &#8211; It will launch Firefox web browser to open a website so it should be installed.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[82927,1],"tags":[83295,83287,83291,83284,83297,83298,83294,83300,83301,83285,83290,83289,83288,83299,83292,83283,83286,83296,83293],"class_list":["post-24864","post","type-post","status-publish","format-standard","hentry","category-c-programming-2","category-coding","tag-best-c-projects","tag-browsec","tag-c-program-to-open-web-browser","tag-c-programming-for-web-development","tag-c-programming-projects-download","tag-c-programming-projects-for-beginners","tag-c-programming-projects-for-engineering-students","tag-c-programming-projects-for-students","tag-c-programming-projects-pdf","tag-how-to-create-a-web-browser-in-c","tag-how-to-open-a-web-page-in-c","tag-how-to-run-c-program-in-web-browser","tag-make-web-browser-in-c","tag-mini-projects-in-c-with-source-code-and-documentation-free-download","tag-open-url-in-c","tag-open-url-using-c-program","tag-shellexecute","tag-simple-mini-project-in-c","tag-web-browser-in-c"],"_links":{"self":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24864","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/comments?post=24864"}],"version-history":[{"count":0,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/posts\/24864\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/media?parent=24864"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/categories?post=24864"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wikitechy.com\/technology\/wp-json\/wp\/v2\/tags?post=24864"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}