From b2805409566af00bc15639494f5a186fbd2f16e6 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 20:15:42 +0000 Subject: More indenting changes --- nGenEx/WebBrowser.cpp | 178 +++++++++++++++++++++++++------------------------- 1 file changed, 89 insertions(+), 89 deletions(-) (limited to 'nGenEx/WebBrowser.cpp') diff --git a/nGenEx/WebBrowser.cpp b/nGenEx/WebBrowser.cpp index 3887f98..0bee58e 100644 --- a/nGenEx/WebBrowser.cpp +++ b/nGenEx/WebBrowser.cpp @@ -1,15 +1,15 @@ /* Project nGenEx - Destroyer Studios LLC - Copyright © 1997-2006. All Rights Reserved. + Destroyer Studios LLC + Copyright © 1997-2006. All Rights Reserved. - SUBSYSTEM: nGenEx.lib - FILE: WebBrowser.cpp - AUTHOR: John DiCamillo + SUBSYSTEM: nGenEx.lib + FILE: WebBrowser.cpp + AUTHOR: John DiCamillo - OVERVIEW - ======== - Helper class to find and launch user's default web browser + OVERVIEW + ======== + Helper class to find and launch user's default web browser */ #include "MemDebug.h" @@ -19,8 +19,8 @@ WebBrowser::WebBrowser() { - FindDefaultBrowser(); - FindOpenCommand(); + FindDefaultBrowser(); + FindOpenCommand(); } WebBrowser::~WebBrowser() @@ -33,31 +33,31 @@ WebBrowser::~WebBrowser() void WebBrowser::OpenURL(const char* url) { - if (url) { - char cmdline[256]; - - if (command.contains("%1")) { - strcpy_s(cmdline, command.replace("%1", url).data()); - } - else { - strcpy_s(cmdline, Text(command + " " + url).data()); - } - - STARTUPINFO s; - ZeroMemory(&s, sizeof(s)); - s.cb = sizeof(s); - - PROCESS_INFORMATION pi; - ZeroMemory(&pi, sizeof(pi)); - - if (CreateProcess(NULL, cmdline, 0, 0, 0, 0, 0, 0, &s, &pi)) { - CloseHandle(pi.hProcess); - CloseHandle(pi.hThread); - } - else { - ::Print("Unable to launch web browser for url '%s'\n", url); - } - } + if (url) { + char cmdline[256]; + + if (command.contains("%1")) { + strcpy_s(cmdline, command.replace("%1", url).data()); + } + else { + strcpy_s(cmdline, Text(command + " " + url).data()); + } + + STARTUPINFO s; + ZeroMemory(&s, sizeof(s)); + s.cb = sizeof(s); + + PROCESS_INFORMATION pi; + ZeroMemory(&pi, sizeof(pi)); + + if (CreateProcess(NULL, cmdline, 0, 0, 0, 0, 0, 0, &s, &pi)) { + CloseHandle(pi.hProcess); + CloseHandle(pi.hThread); + } + else { + ::Print("Unable to launch web browser for url '%s'\n", url); + } + } } // +--------------------------------------------------------------------+ @@ -65,33 +65,33 @@ WebBrowser::OpenURL(const char* url) void WebBrowser::FindDefaultBrowser() { - HKEY hkey; - char value[256] = ""; - DWORD dwSize; - - ZeroMemory(value, 256); - - if (RegOpenKeyEx(HKEY_CLASSES_ROOT, - ".html", - 0, - KEY_READ, - &hkey) == ERROR_SUCCESS) { - - dwSize = 256; - RegQueryValueEx(hkey, - "", - NULL, - NULL, - (LPBYTE) value, - &dwSize); - - RegCloseKey(hkey); - - if (dwSize > 0) { - ::Print("Default Web Browser: %s\n", value); - browser = value; - } - } + HKEY hkey; + char value[256] = ""; + DWORD dwSize; + + ZeroMemory(value, 256); + + if (RegOpenKeyEx(HKEY_CLASSES_ROOT, + ".html", + 0, + KEY_READ, + &hkey) == ERROR_SUCCESS) { + + dwSize = 256; + RegQueryValueEx(hkey, + "", + NULL, + NULL, + (LPBYTE) value, + &dwSize); + + RegCloseKey(hkey); + + if (dwSize > 0) { + ::Print("Default Web Browser: %s\n", value); + browser = value; + } + } } // +--------------------------------------------------------------------+ @@ -99,33 +99,33 @@ WebBrowser::FindDefaultBrowser() void WebBrowser::FindOpenCommand() { - HKEY hkey; - char value[256] = ""; - DWORD dwSize; - - ZeroMemory(value, 256); - - if (RegOpenKeyEx(HKEY_CLASSES_ROOT, - browser + "\\shell\\open\\command", - 0, - KEY_READ, - &hkey) == ERROR_SUCCESS) { - - dwSize = 256; - RegQueryValueEx(hkey, - "", - NULL, - NULL, - (LPBYTE) value, - &dwSize); - - RegCloseKey(hkey); - - if (dwSize > 0) { - ::Print("Browser Shell Open Command: %s\n", value); - command = value; - } - } + HKEY hkey; + char value[256] = ""; + DWORD dwSize; + + ZeroMemory(value, 256); + + if (RegOpenKeyEx(HKEY_CLASSES_ROOT, + browser + "\\shell\\open\\command", + 0, + KEY_READ, + &hkey) == ERROR_SUCCESS) { + + dwSize = 256; + RegQueryValueEx(hkey, + "", + NULL, + NULL, + (LPBYTE) value, + &dwSize); + + RegCloseKey(hkey); + + if (dwSize > 0) { + ::Print("Browser Shell Open Command: %s\n", value); + command = value; + } + } } // +--------------------------------------------------------------------+ -- cgit v1.1