Author: janderwald
Date: Fri Oct 5 19:12:25 2007
New Revision: 29397
URL:
http://svn.reactos.org/svn/reactos?rev=29397&view=rev
Log:
- fix english SHELL_EXTENDED_SHORTCUT_DLG resource dialog
- add runas dialog resource definition (not yet used)
- store runas settings in shortcut properties
Modified:
trunk/reactos/dll/win32/shell32/shell32_En.rc
trunk/reactos/dll/win32/shell32/shelllink.c
trunk/reactos/dll/win32/shell32/shres.rc
trunk/reactos/dll/win32/shell32/shresdef.h
Modified: trunk/reactos/dll/win32/shell32/shell32_En.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shell32_…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shell32_En.rc (original)
+++ trunk/reactos/dll/win32/shell32/shell32_En.rc Fri Oct 5 19:12:25 2007
@@ -157,16 +157,17 @@
PUSHBUTTON "A&dvanced...", 14022, 150, 115, 60, 14, ES_LEFT
}
-SHELL_EXTENDED_SHORTCUT_DLG DIALOGEX 0, 0, 150, 130
+SHELL_EXTENDED_SHORTCUT_DLG DIALOGEX 0, 0, 260, 150
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
CAPTION "Extended Properties"
FONT 8, "MS Shell Dlg", 0, 0, 0x0
{
- LTEXT "Select extended properties for this Shortcut", -1, 5, 30, 150, 10
- CHECKBOX "Execute as a different user", 14000, 30, 50, 150, 10
- LTEXT "FIXME Desc", -1, 50, 70, 200, 40
- PUSHBUTTON "OK", IDOK, 25, 80, 40, 15, WS_VISIBLE
- PUSHBUTTON "Abort", IDCANCEL, 120, 80, 50, 15, WS_VISIBLE
+ LTEXT "Choose the advanced properties you want for this shortcut.", -1, 5,
30, 190, 10
+ CHECKBOX "Run with different credentials", 14000, 30, 50, 150, 10
+ LTEXT "This option can allow you to run the this shortcut as another\nuser, or
continue as yourself while protecting your computer\nand data from unauthorized program
activity.", -1, 50, 60, 200, 40
+ CHECKBOX "Run in seperate memory space", 14001, 30, 100, 90, 10, WS_DISABLED
+ PUSHBUTTON "OK", IDOK, 25, 120, 40, 15, WS_VISIBLE
+ PUSHBUTTON "Abort", IDCANCEL, 120, 120, 50, 15, WS_VISIBLE
}
SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 130
@@ -275,6 +276,26 @@
{
}
+RUN_AS_DIALOG DIALOGEX 0, 0, 240, 190
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_DISABLED | WS_CAPTION
+CAPTION "Run As"
+FONT 8, "MS Shell Dlg", 0, 0, 0x0
+{
+ LTEXT "Which user account do you want to use to run this program?", -1, 30,
30, 170, 10
+ CHECKBOX "Current User %s", 14000, 5, 45, 150, 10
+ LTEXT "Protect my computer and data from unauthorized program activity", -1,
40, 65, 150, 10, WS_DISABLED
+ CHECKBOX "This option can prevent computer viruses from harming your\ncomputer or
personal data, but selecting it might cause the\nprogram to function improperly.",
14001, 40, 80, 150, 10, WS_DISABLED
+ CHECKBOX "The following user:", 14002, 5, 100, 90, 10
+ LTEXT "User name:", -1, 15, 115, 60, 10
+ COMBOBOX 14003, 70, 115, 100, 15, CBS_DROPDOWNLIST | WS_VSCROLL | WS_VISIBLE |
WS_TABSTOP
+
+ PUSHBUTTON "...", 14004, 180, 115, 30, 10, WS_TABSTOP
+ LTEXT "Password:", -1, 15, 140, 60, 10
+ EDITTEXT 14005, 70, 140, 100, 10, ES_LEFT | WS_BORDER | WS_GROUP
+ PUSHBUTTON "...", 14006, 180, 140, 30, 10, WS_TABSTOP
+ PUSHBUTTON "OK", 14007, 70, 170, 60, 15, WS_TABSTOP
+ PUSHBUTTON "Cancel", 14008, 140, 170, 60, 15, WS_TABSTOP
+}
STRINGTABLE DISCARDABLE
{
Modified: trunk/reactos/dll/win32/shell32/shelllink.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shelllin…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shelllink.c (original)
+++ trunk/reactos/dll/win32/shell32/shelllink.c Fri Oct 5 19:12:25 2007
@@ -158,6 +158,7 @@
LPWSTR sProduct;
LPWSTR sComponent;
LPWSTR sLinkPath;
+ BOOL bRunAs;
volume_info volume;
BOOL bDirty;
@@ -919,6 +920,15 @@
r = Stream_LoadAdvertiseInfo( stm, &This->sComponent );
TRACE("Component -> %s\n",debugstr_w(This->sComponent));
}
+ if( hdr.dwFlags & SLDF_RUNAS_USER )
+ {
+ This->bRunAs = TRUE;
+ }
+ else
+ {
+ This->bRunAs = FALSE;
+ }
+
if( FAILED( r ) )
goto end;
@@ -1106,6 +1116,8 @@
header.dwFlags |= SLDF_HAS_LOGO3ID;
if( This->sComponent )
header.dwFlags |= SLDF_HAS_DARWINID;
+ if( This->bRunAs )
+ header.dwFlags |= SLDF_RUNAS_USER;
SystemTimeToFileTime ( &This->time1, &header.Time1 );
SystemTimeToFileTime ( &This->time2, &header.Time2 );
@@ -1219,6 +1231,7 @@
sl->lpvtblObjectWithSite = &owsvt;
sl->iShowCmd = SW_SHOWNORMAL;
sl->bDirty = FALSE;
+ sl->bRunAs = FALSE;
sl->iIdOpen = -1;
sl->site = NULL;
@@ -2559,9 +2572,15 @@
)
{
HWND hDlgCtrl;
+
switch(uMsg)
{
case WM_INITDIALOG:
+ if (lParam)
+ {
+ hDlgCtrl = GetDlgItem(hwndDlg, 14000);
+ SendMessage(hDlgCtrl, BM_SETCHECK, BST_CHECKED, 0);
+ }
return TRUE;
case WM_COMMAND:
hDlgCtrl = GetDlgItem(hwndDlg, 14000);
@@ -2574,7 +2593,7 @@
}
else if (LOWORD(wParam) == IDCANCEL)
{
- EndDialog(hwndDlg, 0);
+ EndDialog(hwndDlg, -1);
}
else if (LOWORD(wParam) == 14000)
{
@@ -2609,6 +2628,7 @@
HWND hDlgCtrl;
WCHAR szBuffer[MAX_PATH];
int IconIndex;
+ INT_PTR result;
This = (IShellLinkImpl *)GetWindowLongPtr(hwndDlg, DWLP_USER);
@@ -2685,13 +2705,15 @@
}
return TRUE;
case 14022:
- if (DialogBox(shell32_hInstance,
MAKEINTRESOURCEW(SHELL_EXTENDED_SHORTCUT_DLG), hwndDlg, ExtendedShortcutProc) > 0)
+ result = DialogBoxParamW(shell32_hInstance,
MAKEINTRESOURCEW(SHELL_EXTENDED_SHORTCUT_DLG), hwndDlg, ExtendedShortcutProc,
(LPARAM)This->bRunAs);
+ if (result == 1 || result == 0)
{
- ///
- /// FIXME
- /// store properties
- ///
http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx
- ///
+ if ( This->bRunAs != result )
+ {
+ PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
+ }
+
+ This->bRunAs = result;
}
return TRUE;
}
Modified: trunk/reactos/dll/win32/shell32/shres.rc
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shres.rc…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shres.rc (original)
+++ trunk/reactos/dll/win32/shell32/shres.rc Fri Oct 5 19:12:25 2007
@@ -46,6 +46,8 @@
#include "shell32_xx.rc"
+
+
/*
* This include a set of Shell32 icons,
* bitmaps and avi files. Licence's can be
Modified: trunk/reactos/dll/win32/shell32/shresdef.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/shell32/shresdef…
==============================================================================
--- trunk/reactos/dll/win32/shell32/shresdef.h (original)
+++ trunk/reactos/dll/win32/shell32/shresdef.h Fri Oct 5 19:12:25 2007
@@ -95,6 +95,7 @@
#define IDD_TITLE 0x3742
#define IDD_TREEVIEW 0x3741
#define SHELL_EXTENDED_SHORTCUT_DLG 0x4000
+#define RUN_AS_DIALOG 0x4001
/*
* Do not alter the icon, bitmap + avi resource