Implemented nsIWebBrowserSiteWindow interface. b=46852, sr=blizzard@mozilla.org

Also added menu option for profile switching.
This commit is contained in:
locka%iol.ie 2001-02-02 13:24:50 +00:00
Родитель 74cb7ca9e7
Коммит b9b3a6093c
5 изменённых файлов: 305 добавлений и 96 удалений

Просмотреть файл

@ -67,10 +67,10 @@ NS_INTERFACE_MAP_BEGIN(WebBrowserChrome)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIWebBrowserChrome)
NS_INTERFACE_MAP_ENTRY(nsIInterfaceRequestor)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserChrome)
NS_INTERFACE_MAP_ENTRY(nsIBaseWindow)
NS_INTERFACE_MAP_ENTRY(nsIWebBrowserSiteWindow)
NS_INTERFACE_MAP_ENTRY(nsIWebProgressListener) // optional
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
// NS_INTERFACE_MAP_ENTRY(nsIPrompt)
NS_INTERFACE_MAP_ENTRY(nsIPrompt)
NS_INTERFACE_MAP_END
//*****************************************************************************
@ -281,117 +281,60 @@ WebBrowserChrome::OnSecurityChange(nsIWebProgress *aWebProgress,
//*****************************************************************************
// WebBrowserChrome::nsIBaseWindow
// WebBrowserChrome::nsIWebBrowserSiteWindow
//*****************************************************************************
NS_IMETHODIMP WebBrowserChrome::InitWindow(nativeWindow aParentNativeWindow,
nsIWidget* parentWidget, PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::Create()
{
NS_ASSERTION(PR_FALSE, "You can't call this");
return NS_ERROR_UNEXPECTED;
}
/* void destroy (); */
NS_IMETHODIMP WebBrowserChrome::Destroy()
{
NS_ASSERTION(PR_FALSE, "You can't call this");
return NS_ERROR_UNEXPECTED;
}
/* void setPosition (in long x, in long y); */
NS_IMETHODIMP WebBrowserChrome::SetPosition(PRInt32 x, PRInt32 y)
{
return mBaseWindow->SetPosition(x, y);
}
NS_IMETHODIMP WebBrowserChrome::GetPosition(PRInt32* x, PRInt32* y)
/* void getPosition (out long x, out long y); */
NS_IMETHODIMP WebBrowserChrome::GetPosition(PRInt32 *x, PRInt32 *y)
{
return mBaseWindow->GetPosition(x, y);
}
/* void setSize (in long cx, in long cy, in boolean fRepaint); */
NS_IMETHODIMP WebBrowserChrome::SetSize(PRInt32 cx, PRInt32 cy, PRBool fRepaint)
{
return mBaseWindow->SetSize(cx, cy, fRepaint);
}
NS_IMETHODIMP WebBrowserChrome::GetSize(PRInt32* cx, PRInt32* cy)
/* void getSize (out long cx, out long cy); */
NS_IMETHODIMP WebBrowserChrome::GetSize(PRInt32 *cx, PRInt32 *cy)
{
return mBaseWindow->GetSize(cx, cy);
}
/* void setPositionAndSize (in long x, in long y, in long cx, in long cy, in boolean fRepaint); */
NS_IMETHODIMP WebBrowserChrome::SetPositionAndSize(PRInt32 x, PRInt32 y, PRInt32 cx, PRInt32 cy, PRBool fRepaint)
{
return mBaseWindow->SetPositionAndSize(x, y, cx, cy, fRepaint);
}
NS_IMETHODIMP WebBrowserChrome::GetPositionAndSize(PRInt32* x, PRInt32* y, PRInt32* cx, PRInt32* cy)
/* void getPositionAndSize (out long x, out long y, out long cx, out long cy); */
NS_IMETHODIMP WebBrowserChrome::GetPositionAndSize(PRInt32 *x, PRInt32 *y, PRInt32 *cx, PRInt32 *cy)
{
return mBaseWindow->GetPositionAndSize(x, y, cx, cy);
}
NS_IMETHODIMP WebBrowserChrome::Repaint(PRBool aForce)
{
return mBaseWindow->Repaint(aForce);
}
NS_IMETHODIMP WebBrowserChrome::GetParentWidget(nsIWidget** aParentWidget)
{
NS_ENSURE_ARG_POINTER(aParentWidget);
NS_ASSERTION(PR_FALSE, "Not Yet Implemented");
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::SetParentWidget(nsIWidget* aParentWidget)
{
NS_ASSERTION(PR_FALSE, "You can't call this");
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::GetParentNativeWindow(nativeWindow* aParentNativeWindow)
{
NS_ENSURE_ARG_POINTER(aParentNativeWindow);
*aParentNativeWindow = mNativeWindow;
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::SetParentNativeWindow(nativeWindow aParentNativeWindow)
{
mNativeWindow = aParentNativeWindow;
return NS_OK;
}
NS_IMETHODIMP WebBrowserChrome::GetVisibility(PRBool* aVisibility)
{
return mBaseWindow->GetVisibility(aVisibility);
}
NS_IMETHODIMP WebBrowserChrome::SetVisibility(PRBool aVisibility)
{
return mBaseWindow->SetVisibility(aVisibility);
}
NS_IMETHODIMP WebBrowserChrome::GetMainWidget(nsIWidget** aMainWidget)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void setFocus (); */
NS_IMETHODIMP WebBrowserChrome::SetFocus()
{
return mBaseWindow->SetFocus();
}
NS_IMETHODIMP WebBrowserChrome::FocusAvailable(nsIBaseWindow* aCurrentFocus,
PRBool* aTookFocus)
{
return mBaseWindow->FocusAvailable(aCurrentFocus, aTookFocus);
}
NS_IMETHODIMP WebBrowserChrome::GetTitle(PRUnichar** aTitle)
/* attribute wstring title; */
NS_IMETHODIMP WebBrowserChrome::GetTitle(PRUnichar * *aTitle)
{
NS_ENSURE_ARG_POINTER(aTitle);
@ -399,8 +342,75 @@ NS_IMETHODIMP WebBrowserChrome::GetTitle(PRUnichar** aTitle)
return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP WebBrowserChrome::SetTitle(const PRUnichar* aTitle)
NS_IMETHODIMP WebBrowserChrome::SetTitle(const PRUnichar * aTitle)
{
return NS_ERROR_NOT_IMPLEMENTED;
return NS_ERROR_NOT_IMPLEMENTED;
}
/* attribute nativeSiteWindow siteWindow */
NS_IMETHODIMP WebBrowserChrome::GetSiteWindow(void * *aSiteWindow)
{
NS_ENSURE_ARG_POINTER(aSiteWindow);
*aSiteWindow = mNativeWindow;
return NS_OK;
}
//*****************************************************************************
// WebBrowserChrome::nsIPrompt
//*****************************************************************************
/* void alert (in wstring dialogTitle, in wstring text); */
NS_IMETHODIMP WebBrowserChrome::Alert(const PRUnichar *dialogTitle, const PRUnichar *text)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void alertCheck (in wstring dialogTitle, in wstring text, in wstring checkMsg, out boolean checkValue); */
NS_IMETHODIMP WebBrowserChrome::AlertCheck(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean confirm (in wstring dialogTitle, in wstring text); */
NS_IMETHODIMP WebBrowserChrome::Confirm(const PRUnichar *dialogTitle, const PRUnichar *text, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean confirmCheck (in wstring dialogTitle, in wstring text, in wstring checkMsg, out boolean checkValue); */
NS_IMETHODIMP WebBrowserChrome::ConfirmCheck(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *checkMsg, PRBool *checkValue, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean prompt (in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, in wstring defaultText, out wstring result); */
NS_IMETHODIMP WebBrowserChrome::Prompt(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *passwordRealm, PRUint32 savePassword, const PRUnichar *defaultText, PRUnichar **result, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean promptUsernameAndPassword (in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, out wstring user, out wstring pwd); */
NS_IMETHODIMP WebBrowserChrome::PromptUsernameAndPassword(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar **user, PRUnichar **pwd, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean promptPassword (in wstring dialogTitle, in wstring text, in wstring passwordRealm, in PRUint32 savePassword, out wstring pwd); */
NS_IMETHODIMP WebBrowserChrome::PromptPassword(const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *passwordRealm, PRUint32 savePassword, PRUnichar **pwd, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* boolean select (in wstring dialogTitle, in wstring text, in PRUint32 count, [array, size_is (count)] in wstring selectList, out long outSelection); */
NS_IMETHODIMP WebBrowserChrome::Select(const PRUnichar *dialogTitle, const PRUnichar *text, PRUint32 count, const PRUnichar **selectList, PRInt32 *outSelection, PRBool *_retval)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* void universalDialog (in wstring titleMessage, in wstring dialogTitle, in wstring text, in wstring checkboxMsg, in wstring button0Text, in wstring button1Text, in wstring button2Text, in wstring button3Text, in wstring editfield1Msg, in wstring editfield2Msg, inout wstring editfield1Value, inout wstring editfield2Value, in wstring iconURL, inout boolean checkboxState, in PRInt32 numberButtons, in PRInt32 numberEditfields, in PRInt32 editField1Password, out PRInt32 buttonPressed); */
NS_IMETHODIMP WebBrowserChrome::UniversalDialog(const PRUnichar *titleMessage, const PRUnichar *dialogTitle, const PRUnichar *text, const PRUnichar *checkboxMsg, const PRUnichar *button0Text, const PRUnichar *button1Text, const PRUnichar *button2Text, const PRUnichar *button3Text, const PRUnichar *editfield1Msg, const PRUnichar *editfield2Msg, PRUnichar **editfield1Value, PRUnichar **editfield2Value, const PRUnichar *iconURL, PRBool *checkboxState, PRInt32 numberButtons, PRInt32 numberEditfields, PRInt32 editField1Password, PRInt32 *buttonPressed)
{
return NS_ERROR_NOT_IMPLEMENTED;
}

Просмотреть файл

@ -31,6 +31,7 @@
#include "nsIContentViewer.h"
#include "nsIContentViewerFile.h"
#include "nsIBaseWindow.h"
#include "nsIWebBrowserSiteWindow.h"
#include "nsIWebNavigation.h"
#include "nsIWebProgressListener.h"
#include "nsIInterfaceRequestor.h"
@ -60,8 +61,8 @@ public:
class WebBrowserChrome : public nsIWebBrowserChrome,
public nsIWebProgressListener,
public nsIBaseWindow,
// public nsIPrompt,
public nsIWebBrowserSiteWindow,
public nsIPrompt,
public nsIInterfaceRequestor,
public nsSupportsWeakReference
{
@ -74,8 +75,8 @@ public:
NS_DECL_ISUPPORTS
NS_DECL_NSIWEBBROWSERCHROME
NS_DECL_NSIWEBPROGRESSLISTENER
NS_DECL_NSIBASEWINDOW
// NS_DECL_NSIPROMPT
NS_DECL_NSIWEBBROWSERSITEWINDOW
NS_DECL_NSIPROMPT
NS_DECL_NSIINTERFACEREQUESTOR
protected:

Просмотреть файл

@ -18,6 +18,7 @@
#define IDC_WINEMBED 109
#define IDR_MAINFRAME 128
#define IDD_BROWSER 130
#define IDD_CHOOSEPROFILE 132
#define MOZ_EDIT_URI 1001
#define IDC_GO 1003
#define IDC_BROWSER 1004
@ -28,6 +29,7 @@
#define IDC_FORWARD 1009
#define IDC_PROGRESS 1010
#define IDC_RELOAD 1011
#define IDC_PROFILELIST 1011
#define MOZ_Open 32771
#define MOZ_Print 32772
#define MOZ_NewBrowser 32773
@ -43,15 +45,16 @@
#define MOZ_GoForward 32783
#define MOZ_About 32784
#define ID_DEBUG_THISSPACEFORRENT 32786
#define MOZ_SwitchProfile 32787
#define IDC_STATIC -1
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 132
#define _APS_NEXT_COMMAND_VALUE 32787
#define _APS_NEXT_CONTROL_VALUE 1011
#define _APS_NEXT_RESOURCE_VALUE 133
#define _APS_NEXT_COMMAND_VALUE 32788
#define _APS_NEXT_CONTROL_VALUE 1012
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif

Просмотреть файл

@ -19,6 +19,7 @@
*
* Contributor(s):
* Doug Turner <dougt@netscape.com>
* Adam Lock <adamlock@netscape.com>
*/
#include <stdio.h>
@ -34,6 +35,7 @@
#include "nsIClipboardCommands.h"
#include "nsXPIDLString.h"
#include "nsIWebBrowserPersist.h"
#include "nsIProfile.h"
// Local header files
#include "WebBrowserChrome.h"
@ -47,10 +49,15 @@ const TCHAR *szWindowClass = _T("WINEMBED");
static ATOM MyRegisterClass(HINSTANCE hInstance);
static LRESULT CALLBACK BrowserWndProc(HWND, UINT, WPARAM, LPARAM);
static BOOL CALLBACK BrowserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
static LRESULT CALLBACK GetURI(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK GetURIDlgProc(HWND, UINT, WPARAM, LPARAM);
static nsresult OpenWebPage(const char * url);
static nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome);
// Profile chooser stuff
static BOOL ChooseNewProfile(BOOL bShowForMultipleProfilesOnly);
static LRESULT CALLBACK ChooseProfileDlgProc(HWND, UINT, WPARAM, LPARAM);
// Global variables
static char gLastURI[100];
static UINT gDialogCount = 0;
@ -84,9 +91,8 @@ int main(int argc, char *argv[])
// Open the initial browser window
OpenWebPage(szFirstURL);
MSG msg;
// Main message loop:
MSG msg;
HANDLE hFakeEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
while (1)
{
@ -174,9 +180,9 @@ HWND GetBrowserFromChrome(nsIWebBrowserChrome *aChrome)
{
return NULL;
}
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(aChrome);
nsCOMPtr<nsIWebBrowserSiteWindow> baseWindow = do_QueryInterface(aChrome);
HWND hwnd = NULL;
baseWindow->GetParentNativeWindow((void**)&hwnd);
baseWindow->GetSiteWindow((void **) & hwnd);
return hwnd;
}
@ -282,10 +288,9 @@ nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome)
if (!chrome)
return NS_ERROR_FAILURE;
nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(chrome);
nsCOMPtr<nsIWebBrowserSiteWindow> baseWindow = do_QueryInterface(chrome);
HWND hWnd;
baseWindow->GetParentNativeWindow((void**)&hWnd);
baseWindow->GetSiteWindow((void **) & hWnd);
if (!hWnd)
return NS_ERROR_NULL_POINTER;
@ -304,8 +309,16 @@ nsresult ResizeEmbedding(nsIWebBrowserChrome* chrome)
rect.right - rect.left,
rect.bottom - rect.top,
PR_TRUE);
baseWindow->SetVisibility(PR_TRUE);
// Make sure the browser is visible
nsCOMPtr<nsIWebBrowser> webBrowser;
chrome->GetWebBrowser(getter_AddRefs(webBrowser));
nsCOMPtr<nsIBaseWindow> webBrowserAsWin = do_QueryInterface(webBrowser);
if (webBrowserAsWin)
{
webBrowserAsWin->SetVisibility(PR_TRUE);
}
return NS_OK;
}
@ -477,12 +490,16 @@ BOOL CALLBACK BrowserDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case MOZ_NewBrowser:
gLastURI[0] = 0;
if (DialogBox(ghInstanceResources, (LPCTSTR)MOZ_GetURI, hwndDlg, (DLGPROC)GetURI) == IDOK)
if (DialogBox(ghInstanceResources, (LPCTSTR)MOZ_GetURI, hwndDlg, (DLGPROC)GetURIDlgProc) == IDOK)
{
OpenWebPage(gLastURI);
}
break;
case MOZ_SwitchProfile:
ChooseNewProfile(FALSE);
break;
case MOZ_Save:
SaveWebPage(webBrowser);
break;
@ -708,11 +725,11 @@ LRESULT CALLBACK BrowserWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM l
//
// FUNCTION: GetURI(HWND, unsigned, WORD, LONG)
// FUNCTION: GetURIDlgProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Dialog handler procedure for the open uri dialog.
//
LRESULT CALLBACK GetURI(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
LRESULT CALLBACK GetURIDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
switch (message)
{
@ -732,6 +749,130 @@ LRESULT CALLBACK GetURI(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
}
///////////////////////////////////////////////////////////////////////////////
// Profile chooser dialog
//
// FUNCTION: ChooseNewProfile()
//
// PURPOSE: Allows the user to select a new profile from a list.
// The bShowForMultipleProfilesOnly argument specifies whether the
// function should automatically select the first profile and return
// without displaying a dialog box if there is only one profile to
// select.
//
BOOL ChooseNewProfile(BOOL bShowForMultipleProfilesOnly)
{
nsresult rv;
NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
if (NS_FAILED(rv))
{
return FALSE;
}
PRInt32 profileCount = 0;
rv = profileService->GetProfileCount(&profileCount);
if (profileCount == 0)
{
// TODO ask them if they wish to create a default profile
// NS_NAMED_LITERAL_STRING(newProfileName, "default");
// rv = profileService->CreateNewProfile(newProfileName, nsnull, nsnull, PR_FALSE);
// rv = profileService->SetCurrentProfile(newProfileName);
return TRUE;
}
else if (profileCount == 1 && bShowForMultipleProfilesOnly)
{
// TODO Select the one and only profile and return
return TRUE;
}
INT nResult;
nResult = DialogBox(ghInstanceResources, (LPCTSTR)IDD_CHOOSEPROFILE, NULL, (DLGPROC)ChooseProfileDlgProc);
return TRUE;
}
//
// FUNCTION: ChooseProfileDlgProc(HWND, unsigned, WORD, LONG)
//
// PURPOSE: Dialog handler procedure for the open uri dialog.
//
LRESULT CALLBACK ChooseProfileDlgProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
nsresult rv;
switch (message)
{
case WM_INITDIALOG:
{
HWND hwndProfileList = GetDlgItem(hDlg, IDC_PROFILELIST);
NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
// Get the list of profile names and add them to the list box
PRUint32 listLen = 0;
PRUnichar **profileList = nsnull;
rv = profileService->GetProfileList(&listLen, &profileList);
for (PRUint32 index = 0; index < listLen; index++)
{
#ifdef UNICODE
SendMessageW(hwndProfileList, LB_ADDSTRING, 0, (LPARAM) profileList[index]);
#else
nsCAutoString profile; profile.AssignWithConversion(profileList[index]);
SendMessageA(hwndProfileList, LB_ADDSTRING, 0, (LPARAM) profile.get());
#endif
}
// Select the current profile (if there is one)
// Get the current profile
#ifdef UNICODE
nsXPIDLString currProfile;
profileService->GetCurrentProfile(getter_Copies(currProfile));
#else
nsXPIDLString currProfileUnicode;
profileService->GetCurrentProfile(getter_Copies(currProfileUnicode));
nsCAutoString currProfile; currProfile.AssignWithConversion(currProfileUnicode);
#endif
// Now find and select it
INT currentProfileIndex = LB_ERR;
currentProfileIndex = SendMessage(hwndProfileList, LB_FINDSTRINGEXACT, -1, (LPARAM) currProfile.get());
if (currentProfileIndex != LB_ERR)
{
SendMessage(hwndProfileList, LB_SETCURSEL, currentProfileIndex, 0);
}
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDOK)
{
HWND hwndProfileList = GetDlgItem(hDlg, IDC_PROFILELIST);
// Get the selected profile from the list box and make it current
INT currentProfileIndex = SendMessage(hwndProfileList, LB_GETCURSEL, 0, 0);
if (currentProfileIndex != LB_ERR)
{
NS_WITH_SERVICE(nsIProfile, profileService, NS_PROFILE_CONTRACTID, &rv);
// Convert TCHAR name to unicode and make it current
INT profileNameLen = SendMessage(hwndProfileList, LB_GETTEXTLEN, currentProfileIndex, 0);
TCHAR *profileName = new TCHAR[profileNameLen + 1];
SendMessage(hwndProfileList, LB_GETTEXT, currentProfileIndex, (LPARAM) profileName);
nsAutoString newProfile; newProfile.AssignWithConversion(profileName);
rv = profileService->SetCurrentProfile(newProfile.GetUnicode());
}
}
EndDialog(hDlg, LOWORD(wParam));
return TRUE;
}
return FALSE;
}
///////////////////////////////////////////////////////////////////////////////
// Win32ChromeUI
@ -778,6 +919,9 @@ nativeWindow Win32ChromeUI::CreateNativeWindow(nsIWebBrowserChrome* chrome)
SendMessage(hwndAddress, CB_ADDSTRING, 0, (LPARAM) _T("http://www.shockwave.com/"));
SendMessage(hwndAddress, CB_ADDSTRING, 0, (LPARAM) _T("http://www.slashdot.org/"));
SendMessage(hwndAddress, CB_ADDSTRING, 0, (LPARAM) _T("http://www.quicken.com/"));
SendMessage(hwndAddress, CB_ADDSTRING, 0, (LPARAM) _T("http://www.hotmail.com/"));
SendMessage(hwndAddress, CB_ADDSTRING, 0, (LPARAM) _T("http://www.cnn.com/"));
SendMessage(hwndAddress, CB_ADDSTRING, 0, (LPARAM) _T("http://www.javasoft.com/"));
// Fetch the browser window handle
HWND hwndBrowser = GetDlgItem(hwndDialog, IDC_BROWSER);

Просмотреть файл

@ -45,6 +45,8 @@ BEGIN
BEGIN
MENUITEM "New Browser...", MOZ_NewBrowser
MENUITEM SEPARATOR
MENUITEM "Switch Profile...", MOZ_SwitchProfile
MENUITEM SEPARATOR
MENUITEM "&Save As...", MOZ_Save
MENUITEM "Print Page", MOZ_Print
MENUITEM "E&xit", IDM_EXIT
@ -196,6 +198,55 @@ END
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// English (Ireland) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENI)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_EIRE
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_CHOOSEPROFILE DIALOG DISCARDABLE 0, 0, 186, 154
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Choose Profile"
FONT 8, "MS Sans Serif"
BEGIN
LTEXT "Available Profiles:",IDC_STATIC,7,7,56,8
LISTBOX IDC_PROFILELIST,7,18,117,129,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "Select",IDOK,129,18,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,36,50,14
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_CHOOSEPROFILE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 147
END
END
#endif // APSTUDIO_INVOKED
#endif // English (Ireland) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////