Windows context menu

This forum is for general support of Xbase++
Message
Author
Piotr D
Posts: 129
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Re: Windows context menu

#11 Post by Piotr D »

Roger,
your concept is good, but my problem is, that I don't know, how can I invoke these programs with option automatically adding a file for signing.
Jimmy,
I tried your suggestion, but efect was the same as with XbpFileDialog. Context menu for file don't have two option, which was under Windows explorer. These are added in registry as DLL:
https://onedrive.live.com/redir?resid=D ... hoto%2cpng
https://onedrive.live.com/redir?resid=D ... hoto%2cpng

Regards
Piotr

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: Windows context menu

#12 Post by Auge_Ohr »

Piotr D wrote: Context menu for file don't have two option, which was under Windows explorer. These are added in registry as DLL:
https://onedrive.live.com/redir?resid=D ... hoto%2cpng
your 2nd Photo show other Registry Key !
i talk about HKEY_CLASSES_ROOT\DesktopBackground which is the free Desktop.

if your Context-Menu is attach to a Explorer Folder you can use "Shell.Application", Namespace(CLSID), FolderItem -> Verbs to activate ( oVerb:Doit() ) a Menu Item
greetings by OHR
Jimmy

Piotr D
Posts: 129
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Re: Windows context menu

#13 Post by Piotr D »

Jimmy,
these context menu option don't exists under HKEY_CLASSES_ROOT\DesktopBackground:

https://onedrive.live.com/redir?resid=D ... hoto%2cpng

Piotr

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: Windows context menu

#14 Post by Auge_Ohr »

hi,

now i see where you are in Registry ...
"OpenWithList" on Right-Menu only appear when i open a Folder an give Item Focus.

Code: Select all

   oShell    := CreateObject("Shell.Application")
   oFolder   := oShell:NameSpace(CSIDL_DESKTOP)
her i open Folder DeskTop (#include "Shfolder.CH" )
Shfolder.zip
Shfolder.CH
(1.24 KiB) Downloaded 768 times
now find all Items (Icons) on Desktop

Code: Select all

   IF NIL <> oFolder
      oItems := oFolder:Items()
      iMax   := oItems:Count

      FOR i := 1 TO iMax
         oItem  := oItems:Item(i-1) // Zero-based 
         IF !EMPTY(oItem)
            AADD(aItems,oItem)
         ENDIF
      NEXT
next look at any Items ( Icon ) which have your Context-Menu Entry -> cSeek

when got Position of cSeek -> add all Verbs ( Menu-Item ) to Array

Code: Select all

      nPosi := ASCAN(aItems,{|x| x:name = cSeek  })
      IF nPosi > 0
         oIcon  := aItems[nPosi]

         oVerbs := oIcon:Verbs()
         jMax   := oVerbs:Count
         FOR j := 1 TO jMax
            oVerb := oVerbs:Item(j-1) // Zero-based 
            ? oVerb:Name
            AADD(aVerbs,oVerb)
         NEXT

         nPosi := ASCAN(aVerbs,{|x| cDoit $ STRTRAN(x:Name,"&","")  })
         IF nPosi > 0
            aVerbs[nPosi]:DoIt()
         ENDIF
      ENDIF
   ENDIF
last Step is to find your Menu-Item -> cDoit.
Windows use "&" (ampersand) as underscore so you have to use STRTRAN()
greetings by OHR
Jimmy

Piotr D
Posts: 129
Joined: Mon Jul 28, 2014 1:26 am
Location: Poznań, Poland

Re: Windows context menu

#15 Post by Piotr D »

Thanks, Jimmy
I tried with your suggestion, but without succes. I becam all shortcuts from desktop, find these programs, but hi don't
have own menu. These context menu items are available only for files (or folders). Context menu for desktop shortcuts
don't have these option.

Piotr

Post Reply