- fix english SHELL_EXTENDED_SHORTCUT_DLG resource dialog

- add runas dialog resource definition (not yet used)
- store runas settings in shortcut properties

svn path=/trunk/; revision=29397
This commit is contained in:
Johannes Anderwald 2007-10-05 15:12:25 +00:00
parent a6b4148654
commit 5e3641128f
4 changed files with 59 additions and 13 deletions

View file

@ -157,16 +157,17 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
PUSHBUTTON "A&dvanced...", 14022, 150, 115, 60, 14, ES_LEFT 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 STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION
CAPTION "Extended Properties" CAPTION "Extended Properties"
FONT 8, "MS Shell Dlg", 0, 0, 0x0 FONT 8, "MS Shell Dlg", 0, 0, 0x0
{ {
LTEXT "Select extended properties for this Shortcut", -1, 5, 30, 150, 10 LTEXT "Choose the advanced properties you want for this shortcut.", -1, 5, 30, 190, 10
CHECKBOX "Execute as a different user", 14000, 30, 50, 150, 10 CHECKBOX "Run with different credentials", 14000, 30, 50, 150, 10
LTEXT "FIXME Desc", -1, 50, 70, 200, 40 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
PUSHBUTTON "OK", IDOK, 25, 80, 40, 15, WS_VISIBLE CHECKBOX "Run in seperate memory space", 14001, 30, 100, 90, 10, WS_DISABLED
PUSHBUTTON "Abort", IDCANCEL, 120, 80, 50, 15, WS_VISIBLE 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 SHELL_FILE_GENERAL_DLG DIALOGEX 0, 0, 240, 130
@ -275,6 +276,26 @@ FONT 8, "MS Shell Dlg", 0, 0, 0x0
{ {
} }
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 STRINGTABLE DISCARDABLE
{ {

View file

@ -158,6 +158,7 @@ typedef struct
LPWSTR sProduct; LPWSTR sProduct;
LPWSTR sComponent; LPWSTR sComponent;
LPWSTR sLinkPath; LPWSTR sLinkPath;
BOOL bRunAs;
volume_info volume; volume_info volume;
BOOL bDirty; BOOL bDirty;
@ -919,6 +920,15 @@ static HRESULT WINAPI IPersistStream_fnLoad(
r = Stream_LoadAdvertiseInfo( stm, &This->sComponent ); r = Stream_LoadAdvertiseInfo( stm, &This->sComponent );
TRACE("Component -> %s\n",debugstr_w(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 ) ) if( FAILED( r ) )
goto end; goto end;
@ -1106,6 +1116,8 @@ static HRESULT WINAPI IPersistStream_fnSave(
header.dwFlags |= SLDF_HAS_LOGO3ID; header.dwFlags |= SLDF_HAS_LOGO3ID;
if( This->sComponent ) if( This->sComponent )
header.dwFlags |= SLDF_HAS_DARWINID; header.dwFlags |= SLDF_HAS_DARWINID;
if( This->bRunAs )
header.dwFlags |= SLDF_RUNAS_USER;
SystemTimeToFileTime ( &This->time1, &header.Time1 ); SystemTimeToFileTime ( &This->time1, &header.Time1 );
SystemTimeToFileTime ( &This->time2, &header.Time2 ); SystemTimeToFileTime ( &This->time2, &header.Time2 );
@ -1219,6 +1231,7 @@ HRESULT WINAPI IShellLink_Constructor( IUnknown *pUnkOuter,
sl->lpvtblObjectWithSite = &owsvt; sl->lpvtblObjectWithSite = &owsvt;
sl->iShowCmd = SW_SHOWNORMAL; sl->iShowCmd = SW_SHOWNORMAL;
sl->bDirty = FALSE; sl->bDirty = FALSE;
sl->bRunAs = FALSE;
sl->iIdOpen = -1; sl->iIdOpen = -1;
sl->site = NULL; sl->site = NULL;
@ -2559,9 +2572,15 @@ INT_PTR CALLBACK ExtendedShortcutProc(
) )
{ {
HWND hDlgCtrl; HWND hDlgCtrl;
switch(uMsg) switch(uMsg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
if (lParam)
{
hDlgCtrl = GetDlgItem(hwndDlg, 14000);
SendMessage(hDlgCtrl, BM_SETCHECK, BST_CHECKED, 0);
}
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
hDlgCtrl = GetDlgItem(hwndDlg, 14000); hDlgCtrl = GetDlgItem(hwndDlg, 14000);
@ -2574,7 +2593,7 @@ INT_PTR CALLBACK ExtendedShortcutProc(
} }
else if (LOWORD(wParam) == IDCANCEL) else if (LOWORD(wParam) == IDCANCEL)
{ {
EndDialog(hwndDlg, 0); EndDialog(hwndDlg, -1);
} }
else if (LOWORD(wParam) == 14000) else if (LOWORD(wParam) == 14000)
{ {
@ -2609,6 +2628,7 @@ SH_ShellLinkDlgProc(
HWND hDlgCtrl; HWND hDlgCtrl;
WCHAR szBuffer[MAX_PATH]; WCHAR szBuffer[MAX_PATH];
int IconIndex; int IconIndex;
INT_PTR result;
This = (IShellLinkImpl *)GetWindowLongPtr(hwndDlg, DWLP_USER); This = (IShellLinkImpl *)GetWindowLongPtr(hwndDlg, DWLP_USER);
@ -2685,13 +2705,15 @@ SH_ShellLinkDlgProc(
} }
return TRUE; return TRUE;
case 14022: 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)
{ {
/// if ( This->bRunAs != result )
/// FIXME {
/// store properties PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
/// http://blogs.msdn.com/vistacompatteam/archive/2006/09/25/771232.aspx }
///
This->bRunAs = result;
} }
return TRUE; return TRUE;
} }

View file

@ -46,6 +46,8 @@ END
#include "shell32_xx.rc" #include "shell32_xx.rc"
/* /*
* This include a set of Shell32 icons, * This include a set of Shell32 icons,
* bitmaps and avi files. Licence's can be * bitmaps and avi files. Licence's can be

View file

@ -95,6 +95,7 @@
#define IDD_TITLE 0x3742 #define IDD_TITLE 0x3742
#define IDD_TREEVIEW 0x3741 #define IDD_TREEVIEW 0x3741
#define SHELL_EXTENDED_SHORTCUT_DLG 0x4000 #define SHELL_EXTENDED_SHORTCUT_DLG 0x4000
#define RUN_AS_DIALOG 0x4001
/* /*
* Do not alter the icon, bitmap + avi resource * Do not alter the icon, bitmap + avi resource