From: Alex Henrie alexhenrie24@gmail.com
--- dlls/ieframe/dochost.c | 15 ++++-------- dlls/ieframe/iexplore.c | 51 ++++++++++++--------------------------- dlls/ieframe/intshcut.c | 17 +++++-------- dlls/ieframe/navigate.c | 20 +++++---------- dlls/ieframe/oleobject.c | 19 +++++---------- dlls/ieframe/webbrowser.c | 4 +-- 6 files changed, 40 insertions(+), 86 deletions(-)
diff --git a/dlls/ieframe/dochost.c b/dlls/ieframe/dochost.c index 97b86d481b9..9d943594614 100644 --- a/dlls/ieframe/dochost.c +++ b/dlls/ieframe/dochost.c @@ -365,13 +365,11 @@ static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l { DocHost *This;
- static const WCHAR wszTHIS[] = {'T','H','I','S',0}; - if(msg == WM_CREATE) { This = *(DocHost**)lParam; - SetPropW(hwnd, wszTHIS, This); + SetPropW(hwnd, L"THIS", This); }else { - This = GetPropW(hwnd, wszTHIS); + This = GetPropW(hwnd, L"THIS"); }
switch(msg) { @@ -485,9 +483,6 @@ void create_doc_view_hwnd(DocHost *This) { RECT rect;
- static const WCHAR wszShell_DocObject_View[] = - {'S','h','e','l','l',' ','D','o','c','O','b','j','e','c','t',' ','V','i','e','w',0}; - if(!doc_view_atom) { static WNDCLASSEXW wndclass = { sizeof(wndclass), @@ -495,7 +490,7 @@ void create_doc_view_hwnd(DocHost *This) doc_view_proc, 0, 0 /* native uses 4*/, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, - wszShell_DocObject_View, + L"Shell DocObject View", NULL };
@@ -505,8 +500,8 @@ void create_doc_view_hwnd(DocHost *This) }
This->container_vtbl->get_docobj_rect(This, &rect); - This->hwnd = CreateWindowExW(0, wszShell_DocObject_View, - wszShell_DocObject_View, + This->hwnd = CreateWindowExW(0, L"Shell DocObject View", + L"Shell DocObject View", WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP, rect.left, rect.top, rect.right, rect.bottom, This->frame_hwnd, NULL, ieframe_instance, This); diff --git a/dlls/ieframe/iexplore.c b/dlls/ieframe/iexplore.c index 6ed540b14ad..ba596c3c9c9 100644 --- a/dlls/ieframe/iexplore.c +++ b/dlls/ieframe/iexplore.c @@ -49,11 +49,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
#define WM_UPDATEADDRBAR (WM_APP+1)
-static const WCHAR szIEWinFrame[] = { 'I','E','F','r','a','m','e',0 }; - /* Windows uses "Microsoft Internet Explorer" */ -static const WCHAR wszWineInternetExplorer[] = - {'W','i','n','e',' ','I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',0}; +static const WCHAR wszWineInternetExplorer[] = L"Wine Internet Explorer";
static LONG obj_cnt; static DWORD dde_inst; @@ -170,7 +167,6 @@ static void add_fav_to_menu(HMENU favmenu, HMENU menu, LPWSTR title, LPCWSTR url
static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir) { - static const WCHAR search[] = {'*',0}; WCHAR path[MAX_PATH*2]; WCHAR* filename; HANDLE findhandle; @@ -180,7 +176,7 @@ static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir) HRESULT res;
lstrcpyW(path, dir); - PathAppendW(path, search); + PathAppendW(path, L"*");
findhandle = FindFirstFileW(path, &finddata);
@@ -194,7 +190,7 @@ static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir)
if(SUCCEEDED(res)) { - filename = path + lstrlenW(path) - lstrlenW(search); + filename = path + lstrlenW(path) - strlen("*");
do { @@ -202,11 +198,9 @@ static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir)
if(finddata.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) { - static const WCHAR ignore1[] = {'.','.',0}; - static const WCHAR ignore2[] = {'.',0}; MENUITEMINFOW item;
- if(!lstrcmpW(filename, ignore1) || !lstrcmpW(filename, ignore2)) + if(!lstrcmpW(filename, L"..") || !lstrcmpW(filename, L".")) continue;
item.cbSize = sizeof(item); @@ -217,11 +211,10 @@ static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir) add_favs_to_menu(favmenu, item.hSubMenu, path); } else { - static const WCHAR urlext[] = {'.','u','r','l',0}; WCHAR* fileext; WCHAR* url = NULL;
- if(lstrcmpiW(PathFindExtensionW(filename), urlext)) + if(lstrcmpiW(PathFindExtensionW(filename), L".url")) continue;
if(FAILED(IPersistFile_Load(urlfile, path, 0))) @@ -232,7 +225,7 @@ static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir) if(!url) continue;
- fileext = filename + lstrlenW(filename) - lstrlenW(urlext); + fileext = filename + lstrlenW(filename) - lstrlenW(L".url"); *fileext = 0; add_fav_to_menu(favmenu, menu, filename, url); } @@ -250,17 +243,12 @@ static void add_favs_to_menu(HMENU favmenu, HMENU menu, LPCWSTR dir)
static void add_tbs_to_menu(HMENU menu) { - static const WCHAR toolbar_key[] = {'S','o','f','t','w','a','r','e','\', - 'M','i','c','r','o','s','o','f','t','\', - 'I','n','t','e','r','n','e','t',' ', - 'E','x','p','l','o','r','e','r','\', - 'T','o','o','l','b','a','r',0}; + static const WCHAR toolbar_key[] = L"Software\Microsoft\Internet Explorer\Toolbar"; HUSKEY toolbar_handle;
if(SHRegOpenUSKeyW(toolbar_key, KEY_READ, NULL, &toolbar_handle, TRUE) == ERROR_SUCCESS) { - static const WCHAR classes_key[] = {'S','o','f','t','w','a','r','e','\', - 'C','l','a','s','s','e','s','\','C','L','S','I','D',0}; + static const WCHAR classes_key[] = L"Software\Classes\CLSID"; HUSKEY classes_handle; WCHAR guid[39]; DWORD value_len = ARRAY_SIZE(guid); @@ -713,7 +701,7 @@ void register_iewindow_class(void) GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED); wc.hCursor = LoadCursorW(0, (LPWSTR)IDC_ARROW); wc.hbrBackground = 0; - wc.lpszClassName = szIEWinFrame; + wc.lpszClassName = L"IEFrame"; wc.lpszMenuName = NULL;
RegisterClassExW(&wc); @@ -721,14 +709,14 @@ void register_iewindow_class(void)
void unregister_iewindow_class(void) { - UnregisterClassW(szIEWinFrame, ieframe_instance); + UnregisterClassW(L"IEFrame", ieframe_instance); }
static void create_frame_hwnd(InternetExplorer *This) { CreateWindowExW( WS_EX_WINDOWEDGE, - szIEWinFrame, wszWineInternetExplorer, + L"IEFrame", wszWineInternetExplorer, WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, @@ -1092,20 +1080,17 @@ static void init_dde(void) { UINT res;
- static const WCHAR iexploreW[] = {'I','E','x','p','l','o','r','e',0}; - static const WCHAR openurlW[] = {'W','W','W','_','O','p','e','n','U','R','L',0}; - res = DdeInitializeW(&dde_inst, dde_proc, CBF_SKIP_ALLNOTIFICATIONS | CBF_FAIL_ADVISES | CBF_FAIL_POKES, 0); if(res != DMLERR_NO_ERROR) { WARN("DdeInitialize failed: %u\n", res); return; }
- ddestr_iexplore = DdeCreateStringHandleW(dde_inst, iexploreW, CP_WINUNICODE); + ddestr_iexplore = DdeCreateStringHandleW(dde_inst, L"IExplore", CP_WINUNICODE); if(!ddestr_iexplore) WARN("Failed to create string handle: %u\n", DdeGetLastError(dde_inst));
- ddestr_openurl = DdeCreateStringHandleW(dde_inst, openurlW, CP_WINUNICODE); + ddestr_openurl = DdeCreateStringHandleW(dde_inst, L"WWW_OpenURL", CP_WINUNICODE); if(!ddestr_openurl) WARN("Failed to create string handle: %u\n", DdeGetLastError(dde_inst));
@@ -1139,10 +1124,6 @@ DWORD WINAPI IEWinMain(const WCHAR *cmdline, int nShowWindow) ULONG_PTR context_cookie; ACTCTXW actctx;
- static const WCHAR embeddingW[] = {'-','e','m','b','e','d','d','i','n','g',0}; - static const WCHAR nohomeW[] = {'-','n','o','h','o','m','e',0}; - static const WCHAR startmanagerW[] = {'-','s','t','a','r','t','m','a','n','a','g','e','r',0}; - TRACE("%s %d\n", debugstr_w(cmdline), nShowWindow);
CoInitialize(NULL); @@ -1167,11 +1148,11 @@ DWORD WINAPI IEWinMain(const WCHAR *cmdline, int nShowWindow)
while (cmdline[length] && cmdline[length] != ' ' && cmdline[length] != '\t') length++;
- if (!wcsnicmp(cmdline, embeddingW, length)) + if (!wcsnicmp(cmdline, L"-embedding", length)) embedding = TRUE; - else if (!wcsnicmp(cmdline, nohomeW, length)) + else if (!wcsnicmp(cmdline, L"-nohome", length)) nohome = TRUE; - else if (!wcsnicmp(cmdline, startmanagerW, length)) + else if (!wcsnicmp(cmdline, L"-startmanager", length)) manager = TRUE; else break; diff --git a/dlls/ieframe/intshcut.c b/dlls/ieframe/intshcut.c index b992305a724..fd28d8dc24c 100644 --- a/dlls/ieframe/intshcut.c +++ b/dlls/ieframe/intshcut.c @@ -82,7 +82,7 @@ static inline InternetShortcut* impl_from_IPropertySetStorage(IPropertySetStorag
static BOOL run_winemenubuilder( const WCHAR *args ) { - static const WCHAR menubuilder[] = {'\','w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',0}; + static const WCHAR menubuilder[] = L"\winemenubuilder.exe"; LONG len; LPWSTR buffer; STARTUPINFOW si; @@ -124,7 +124,7 @@ static BOOL run_winemenubuilder( const WCHAR *args )
static BOOL StartLinkProcessor( LPCOLESTR szLink ) { - static const WCHAR szFormat[] = { ' ','-','w',' ','-','u',' ','"','%','s','"',0 }; + static const WCHAR szFormat[] = L" -w -u "%s""; LONG len; LPWSTR buffer; BOOL ret; @@ -260,7 +260,6 @@ static HRESULT WINAPI UniformResourceLocatorW_InvokeCommand(IUniformResourceLoca InternetShortcut *This = impl_from_IUniformResourceLocatorW(url); WCHAR app[64]; HKEY hkey; - static const WCHAR wszURLProtocol[] = {'U','R','L',' ','P','r','o','t','o','c','o','l',0}; SHELLEXECUTEINFOW sei; DWORD res, type; HRESULT hres; @@ -284,7 +283,7 @@ static HRESULT WINAPI UniformResourceLocatorW_InvokeCommand(IUniformResourceLoca if(res != ERROR_SUCCESS) return E_FAIL;
- res = RegQueryValueExW(hkey, wszURLProtocol, NULL, &type, NULL, NULL); + res = RegQueryValueExW(hkey, L"URL Protocol", NULL, &type, NULL, NULL); RegCloseKey(hkey); if(res != ERROR_SUCCESS || type != REG_SZ) return E_FAIL; @@ -454,10 +453,6 @@ static HRESULT get_profile_string(LPCWSTR lpAppName, LPCWSTR lpKeyName,
static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileName, DWORD dwMode) { - static const WCHAR str_header[] = {'I','n','t','e','r','n','e','t','S','h','o','r','t','c','u','t',0}; - static const WCHAR str_URL[] = {'U','R','L',0}; - static const WCHAR str_iconfile[] = {'i','c','o','n','f','i','l','e',0}; - static const WCHAR str_iconindex[] = {'i','c','o','n','i','n','d','e','x',0}; InternetShortcut *This = impl_from_IPersistFile(pFile); WCHAR *filename = NULL; WCHAR *url; @@ -475,7 +470,7 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam if (!filename) return E_OUTOFMEMORY;
- if (FAILED(hr = get_profile_string(str_header, str_URL, pszFileName, &url))) + if (FAILED(hr = get_profile_string(L"InternetShortcut", L"URL", pszFileName, &url))) { CoTaskMemFree(filename); return hr; @@ -500,7 +495,7 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam If we don't find them, that's not a failure case -- it's possible that they just aren't in there. */
- if (get_profile_string(str_header, str_iconfile, pszFileName, &iconfile) == S_OK) + if (get_profile_string(L"InternetShortcut", L"iconfile", pszFileName, &iconfile) == S_OK) { PROPSPEC ps; PROPVARIANT pv; @@ -514,7 +509,7 @@ static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileNam } CoTaskMemFree(iconfile);
- if (get_profile_string(str_header, str_iconindex, pszFileName, &iconindexstring) == S_OK) + if (get_profile_string(L"InternetShortcut", L"iconindex", pszFileName, &iconindexstring) == S_OK) { int iconindex; PROPSPEC ps; diff --git a/dlls/ieframe/navigate.c b/dlls/ieframe/navigate.c index 48cd5997939..3d2681cf508 100644 --- a/dlls/ieframe/navigate.c +++ b/dlls/ieframe/navigate.c @@ -678,8 +678,6 @@ static BOOL try_application_url(LPCWSTR url) DWORD res, type; HRESULT hres;
- static const WCHAR wszURLProtocol[] = {'U','R','L',' ','P','r','o','t','o','c','o','l',0}; - hres = CoInternetParseUrl(url, PARSE_SCHEMA, 0, app, ARRAY_SIZE(app), NULL, 0); if(FAILED(hres)) return FALSE; @@ -688,7 +686,7 @@ static BOOL try_application_url(LPCWSTR url) if(res != ERROR_SUCCESS) return FALSE;
- res = RegQueryValueExW(hkey, wszURLProtocol, NULL, &type, NULL, NULL); + res = RegQueryValueExW(hkey, L"URL Protocol", NULL, &type, NULL, NULL); RegCloseKey(hkey); if(res != ERROR_SUCCESS || type != REG_SZ) return FALSE; @@ -1102,22 +1100,16 @@ HRESULT go_home(DocHost *This) HKEY hkey; DWORD res, type, size; WCHAR wszPageName[MAX_PATH]; - static const WCHAR wszAboutBlank[] = {'a','b','o','u','t',':','b','l','a','n','k',0}; - static const WCHAR wszStartPage[] = {'S','t','a','r','t',' ','P','a','g','e',0}; - static const WCHAR wszSubKey[] = {'S','o','f','t','w','a','r','e','\', - 'M','i','c','r','o','s','o','f','t','\', - 'I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r','\', - 'M','a','i','n',0}; - - res = RegOpenKeyW(HKEY_CURRENT_USER, wszSubKey, &hkey); + + res = RegOpenKeyW(HKEY_CURRENT_USER, L"Software\Microsoft\Internet Explorer\Main", &hkey); if (res != ERROR_SUCCESS) - return navigate_url(This, wszAboutBlank, NULL, NULL, NULL, NULL); + return navigate_url(This, L"about:blank", NULL, NULL, NULL, NULL);
size = sizeof(wszPageName); - res = RegQueryValueExW(hkey, wszStartPage, NULL, &type, (LPBYTE)wszPageName, &size); + res = RegQueryValueExW(hkey, L"Start Page", NULL, &type, (LPBYTE)wszPageName, &size); RegCloseKey(hkey); if (res != ERROR_SUCCESS || type != REG_SZ) - return navigate_url(This, wszAboutBlank, NULL, NULL, NULL, NULL); + return navigate_url(This, L"about:blank", NULL, NULL, NULL, NULL);
return navigate_url(This, wszPageName, NULL, NULL, NULL, NULL); } diff --git a/dlls/ieframe/oleobject.c b/dlls/ieframe/oleobject.c index 742e78ce4e4..c818b60875b 100644 --- a/dlls/ieframe/oleobject.c +++ b/dlls/ieframe/oleobject.c @@ -69,13 +69,11 @@ static LRESULT WINAPI shell_embedding_proc(HWND hwnd, UINT msg, WPARAM wParam, L { WebBrowser *This;
- static const WCHAR wszTHIS[] = {'T','H','I','S',0}; - if(msg == WM_CREATE) { This = *(WebBrowser**)lParam; - SetPropW(hwnd, wszTHIS, This); + SetPropW(hwnd, L"THIS", This); }else { - This = GetPropW(hwnd, wszTHIS); + This = GetPropW(hwnd, L"THIS"); }
switch(msg) { @@ -100,9 +98,6 @@ static void create_shell_embedding_hwnd(WebBrowser *This) HWND parent = NULL; HRESULT hres;
- static const WCHAR wszShellEmbedding[] = - {'S','h','e','l','l',' ','E','m','b','e','d','d','i','n','g',0}; - if(!shell_embedding_atom) { static WNDCLASSEXW wndclass = { sizeof(wndclass), @@ -110,7 +105,7 @@ static void create_shell_embedding_hwnd(WebBrowser *This) shell_embedding_proc, 0, 0 /* native uses 8 */, NULL, NULL, NULL, (HBRUSH)(COLOR_WINDOW + 1), NULL, - wszShellEmbedding, + L"Shell Embedding", NULL }; wndclass.hInstance = ieframe_instance; @@ -126,7 +121,7 @@ static void create_shell_embedding_hwnd(WebBrowser *This)
This->doc_host.frame_hwnd = This->shell_embedding_hwnd = CreateWindowExW( WS_EX_WINDOWEDGE, - wszShellEmbedding, wszShellEmbedding, + L"Shell Embedding", L"Shell Embedding", WS_CLIPSIBLINGS | WS_CLIPCHILDREN | (parent ? WS_CHILD | WS_TABSTOP : WS_POPUP | WS_MAXIMIZEBOX), 0, 0, 0, 0, parent, @@ -201,8 +196,6 @@ static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site) { HRESULT hres;
- static const WCHAR wszitem[] = {'i','t','e','m',0}; - if(This->inplace) { if(This->shell_embedding_hwnd) @@ -220,9 +213,9 @@ static HRESULT activate_ui(WebBrowser *This, IOleClientSite *active_site) IOleInPlaceSiteEx_OnUIActivate(This->inplace);
if(This->doc_host.frame) - IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, &This->IOleInPlaceActiveObject_iface, wszitem); + IOleInPlaceFrame_SetActiveObject(This->doc_host.frame, &This->IOleInPlaceActiveObject_iface, L"item"); if(This->uiwindow) - IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, &This->IOleInPlaceActiveObject_iface, wszitem); + IOleInPlaceUIWindow_SetActiveObject(This->uiwindow, &This->IOleInPlaceActiveObject_iface, L"item");
if(This->doc_host.frame) IOleInPlaceFrame_SetMenu(This->doc_host.frame, NULL, NULL, This->shell_embedding_hwnd); diff --git a/dlls/ieframe/webbrowser.c b/dlls/ieframe/webbrowser.c index cd0143acd22..857287f6311 100644 --- a/dlls/ieframe/webbrowser.c +++ b/dlls/ieframe/webbrowser.c @@ -612,13 +612,11 @@ static HRESULT WINAPI WebBrowser_GetProperty(IWebBrowser2 *iface, BSTR szPropert
static HRESULT WINAPI WebBrowser_get_Name(IWebBrowser2 *iface, BSTR *Name) { - static const WCHAR sName[] = {'M','i','c','r','o','s','o','f','t',' ','W','e','b', - ' ','B','r','o','w','s','e','r',' ','C','o','n','t','r','o','l',0}; WebBrowser *This = impl_from_IWebBrowser2(iface);
TRACE("(%p)->(%p)\n", This, Name);
- *Name = SysAllocString(sName); + *Name = SysAllocString(L"Microsoft Web Browser Control");
return S_OK; }