Added a Open dialog. Right now it still opens new windows
rather than opening documents in a existing ibrowser window.
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser.cpp
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser.h
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser_intres.h
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser_intres.rc
Modified: trunk/reactos/subsys/system/ibrowser/mainframe.cpp
_____
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser.cpp
--- trunk/reactos/subsys/system/ibrowser/ibrowser.cpp 2005-02-20
19:07:24 UTC (rev 13693)
+++ trunk/reactos/subsys/system/ibrowser/ibrowser.cpp 2005-02-20
19:51:38 UTC (rev 13694)
@@ -417,8 +417,38 @@
{
Dialog::DoModal(IDD_ABOUT_IBROWSER,
WINDOW_CREATOR(ExplorerAboutDlg), hwndParent);
}
+void ibrowser_open(HWND hwndParent)
+{
+ HMODULE hShell32;
+ RUNFILEDLG RunFileDlg;
+ OSVERSIONINFO versionInfo;
+ WCHAR wTitle[40];
+ WCHAR wText[256];
+ char szTitle[40] = "Open";
+ char szText[256] = "Type the Internet Address of a
document or folder and IBrowser will open it for you.";
+ hShell32 = LoadLibrary(_T("SHELL32.DLL"));
+ RunFileDlg = (RUNFILEDLG)(FARPROC)GetProcAddress(hShell32,
(char*)((long)0x3D));
+ /* Show "Run..." dialog */
+ if (RunFileDlg)
+ {
+ versionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+ GetVersionEx(&versionInfo);
+
+ if (versionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT)
+ {
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szTitle, -1,
wTitle, 40);
+ MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, szText, -1,
wText, 256);
+ RunFileDlg(hwndParent, 0, NULL, (LPCSTR)wTitle,
(LPCSTR)wText, RFF_CALCDIRECTORY);
+ }
+ else
+ RunFileDlg(hwndParent, 0, NULL, szTitle, szText,
RFF_CALCDIRECTORY);
+ }
+
+ FreeLibrary(hShell32);
+}
+
static void InitInstance(HINSTANCE hInstance)
{
CONTEXT("InitInstance");
_____
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser.h
--- trunk/reactos/subsys/system/ibrowser/ibrowser.h 2005-02-20
19:07:24 UTC (rev 13693)
+++ trunk/reactos/subsys/system/ibrowser/ibrowser.h 2005-02-20
19:51:38 UTC (rev 13694)
@@ -214,3 +214,18 @@
// display explorer "About" dialog
extern void ibrowser_about(HWND hwndParent);
+ // display explorer "open" dialog
+extern void ibrowser_open(HWND hwndParent);
+
+ // declare shell32's "Run..." dialog export function
+typedef void (WINAPI* RUNFILEDLG)(HWND hwndOwner, HICON hIcon,
LPCSTR lpstrDirectory, LPCSTR lpstrTitle, LPCSTR lpstrDescription, UINT
uFlags);
+
+ //
+ // Flags for RunFileDlg
+ //
+
+#define RFF_NOBROWSE 0x01 // Removes the browse
button.
+#define RFF_NODEFAULT 0x02 // No default item
selected.
+#define RFF_CALCDIRECTORY 0x04 // Calculates the
working directory from the file name.
+#define RFF_NOLABEL 0x08 // Removes the
edit box label.
+#define RFF_NOSEPARATEMEM 0x20 // Removes the Separate
Memory Space check box (Windows NT only).
_____
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser_intres.h
--- trunk/reactos/subsys/system/ibrowser/ibrowser_intres.h
2005-02-20 19:07:24 UTC (rev 13693)
+++ trunk/reactos/subsys/system/ibrowser/ibrowser_intres.h
2005-02-20 19:51:38 UTC (rev 13694)
@@ -35,6 +35,7 @@
#define ID_GO_SEARCH 40008
#define ID_GO_UP 40009
#define ID_STOP 40010
+#define ID_FILE_OPEN 0xE140
#define ID_FILE_EXIT 0xE141
#define ID_HELP 0xE146
#define IDC_STATIC -1
_____
Modified: trunk/reactos/subsys/system/ibrowser/ibrowser_intres.rc
--- trunk/reactos/subsys/system/ibrowser/ibrowser_intres.rc
2005-02-20 19:07:24 UTC (rev 13693)
+++ trunk/reactos/subsys/system/ibrowser/ibrowser_intres.rc
2005-02-20 19:51:38 UTC (rev 13694)
@@ -252,6 +252,7 @@
BEGIN
POPUP "&File"
BEGIN
+ MENUITEM "&Open", ID_FILE_OPEN
MENUITEM "E&xit", ID_FILE_EXIT
END
POPUP "&View"
_____
Modified: trunk/reactos/subsys/system/ibrowser/mainframe.cpp
--- trunk/reactos/subsys/system/ibrowser/mainframe.cpp 2005-02-20
19:07:24 UTC (rev 13693)
+++ trunk/reactos/subsys/system/ibrowser/mainframe.cpp 2005-02-20
19:51:38 UTC (rev 13694)
@@ -262,6 +262,10 @@
CONTEXT("MainFrameBase::Command()");
switch(id) {
+ case ID_FILE_OPEN:
+ ibrowser_open(_hwnd);
+ break;
+
case ID_FILE_EXIT:
SendMessage(_hwnd, WM_CLOSE, 0, 0);
break;
Show replies by date