Page 1 of 1

Files as attachm. via context menu (Send to) no longer works

Posted: 2012-05-22, 12:53 UTC
by DoobieB
I'm running TC 8.0 RC 2 under Win7 32-bit with Office/Outlook 2010 Professional Plus 2010 (... most recent fixes applied) and sending files as attachements via context menu (Send to) no longer works. No problem with "vanilla" Windows Explorer. Context menu opens properly but neither by right click nor by shift + F10 a new email opens and file will be attached .... no error msg - nothing happens.

:(

Posted: 2012-05-22, 13:09 UTC
by karlchen
Hello, DoobieB.

Just tried it here. No problem. Total Commander 8.0rc2 32-bit => Sendto => E-Mail Recipient works as expected. Outlook 2010 opens. The selected file has been attached.

Windows 7 Enterprise SP1 32-bit
Office 2010 SP1
Outlook 2010
Total Commander 8.0rc2

Cheers,
Karl

Posted: 2012-05-22, 14:04 UTC
by Horst.Epp
Sendto => E-Mail Recipient
works here with TC 8 RC2 x86 and x64
under Windows 7 x64 Ultimate.

Posted: 2012-05-22, 17:22 UTC
by HolgerK
Confirmed (TC8.0RC2 x64/x86, Win7 x64, Office2010 x86, all updates applied)
But : only under the condition that TC runs elevated (as administrator).
<Edit>
BTW: This seems to be a general problem of "send to" because an elevated Explorer fails as well.
Oops,sorry: after trying a second time, elevated Explorer seems to work correct.
</Edit>

<Edit2>
Same effect with ThunderBird 12.01. So it's not an Office specific problem.
</Edit2>

Regards
Holger

Posted: 2012-05-22, 20:43 UTC
by DoobieB
Hello karlchen,

you're saying"... Outlook 2010 opens. The selected file has been attached.". It's only working for me when Outlook is not up and running. If it's already running it doesn't work.

Posted: 2012-05-22, 20:48 UTC
by petermad
Works fine here with TC 8.0RC2 on Windows XP (32bit TC) and Windows 7 (32bit and 64bit TC).

All tests with Mozilla SeaMonkey as email client, both when Seamonkey is already running, and when it is not.

I an NOT running TC elevated, but I am running Windows as administrator.

Posted: 2012-05-22, 22:25 UTC
by karlchen
Hello, DoobieB.
you're saying"... Outlook 2010 opens. The selected file has been attached.". It's only working for me when Outlook is not up and running. If it's already running it doesn't work.
Does not matter here. In case Outlook is not running it will be launched and closed after sending the mail. In case Outlook had been started before a new e-mail window will be opened instead and after sending the e-mail only this window will be closed, but Outlook will be still open.

I assume that the factor which HolgerK has reported may be one possible source of trouble: Outlook and Total Commander having different security contexts, most likely T.C. being run elevated "as administrator", but Outlook being run non-elevated. (Unless UAC has been switched off completely this may happen, even though your user account is named "Administrator". The name "Administrator" does not imply you are doing anything in elevated mode automatically. "Administrator" is just a name.)

Kind regards,
Karl

Posted: 2012-05-23, 13:47 UTC
by ghisler(Author)
Outlook and Total Commander having different security contexts, most likely T.C. being run elevated "as administrator", but Outlook being run non-elevated.
I also think that this is the problem. Windows blocks the communication between a program with normal rights and one with higher rights.

Posted: 2012-05-23, 15:09 UTC
by MarcinW
There is a way to enable communication with lower privileged processes. I've found a description of enabling drag&drop somewhere in the internet and I created the following piece of code:

Code: Select all

procedure DragDropInit(Wnd : HWND = 0);
const
  WM_COPYGLOBALDATA = $0049;
  MSGFLT_ADD = 1;
  MSGFLT_ALLOW = 1;
var
  ChangeWindowMessageFilter : function(message : UINT; dwFlag : DWORD) : BOOL; stdcall;
  ChangeWindowMessageFilterEx : function(hWnd : HWND; message : UINT; action : DWORD; pChangeFilterStruct : Pointer) : BOOL; stdcall;
begin
  @ChangeWindowMessageFilter:=GetProcAddress(GetModuleHandle(user32),'ChangeWindowMessageFilter');
  @ChangeWindowMessageFilterEx:=GetProcAddress(GetModuleHandle(user32),'ChangeWindowMessageFilterEx');
  if Assigned(ChangeWindowMessageFilter) then
  if (Wnd <> 0) and Assigned(ChangeWindowMessageFilterEx) then
  begin
    if not ChangeWindowMessageFilterEx(Wnd,WM_DROPFILES,MSGFLT_ALLOW,nil) then
      ChangeWindowMessageFilter(WM_DROPFILES,MSGFLT_ADD);
    if not ChangeWindowMessageFilterEx(Wnd,WM_COPYDATA,MSGFLT_ALLOW,nil) then
      ChangeWindowMessageFilter(WM_COPYDATA,MSGFLT_ADD);
    if not ChangeWindowMessageFilterEx(Wnd,WM_COPYGLOBALDATA,MSGFLT_ALLOW,nil) then
      ChangeWindowMessageFilter(WM_COPYGLOBALDATA,MSGFLT_ADD);
  end else
  begin
    ChangeWindowMessageFilter(WM_DROPFILES,MSGFLT_ADD);
    ChangeWindowMessageFilter(WM_COPYDATA,MSGFLT_ADD);
    ChangeWindowMessageFilter(WM_COPYGLOBALDATA,MSGFLT_ADD);
  end;
end;
Regards

Posted: 2012-05-23, 15:29 UTC
by ghisler(Author)
Wow, that's nice! Unfortunately I haven't seen this before. Is there any overview of new Windows Vista/7 functions anywhere?

Anyway, I will try to add it to the next version of TC (probably 8.1).

Posted: 2012-05-24, 03:23 UTC
by MarcinW
I suppose that the easiest way to obtain a full list of new API functions is to download Visual Studio 2010 Express (it's free). There is a lot of *.h files there (the most important is "WinUser.h") - new Vista functions are surrounded by "#if(_WIN32_WINNT >= 0x0600)" or "#if(_WIN32_WINNT >= 0x0601)".

Regards!

Posted: 2012-05-24, 15:57 UTC
by ghisler(Author)
Thanks for the suggestion. Moving thread to suggestions forum.