From: Norm on 7 May 2010 20:56 I have the following code to set a right click context menu in explorer that my program will respond to. Everything works fine, except if I right click on an .exe file and then left click on the context menu for my program. I get a message from Windows asking if I want to run the program and I have the option to click on OK or Cancel. So for some reason Windows is intercepting my right click message before it gets to my program, but only on .exe files. Here is the code to set the context menu: fWriteValue "HKCR", "*\shell\Erase With FileClean", "icon", "S", App.Path & "\FileClean.exe" fWriteValue "HKCR", "*\shell\Erase With FileClean\command", "", "S", App.Path & "\FileClean.exe %1" For some reason when right clicking on an .exe the value never gets written to the registry. Is there some part of the value %1 that I am missing? Thanks, Norm
From: Norm on 7 May 2010 21:19 "Norm" <NormF4(a)spoof.com> wrote in message news:2A483E8C-9B7F-4CB8-8EF3-E585E997F790(a)microsoft.com... > I have the following code to set a right click context menu in explorer > that my program will respond to. Everything works fine, except if I right > click on an .exe file and then left click on the context menu for my > program. I get a message from Windows asking if I want to run the program > and I have the option to click on OK or Cancel. So for some reason Windows > is intercepting my right click message before it gets to my program, but > only on .exe files. > > Here is the code to set the context menu: > > fWriteValue "HKCR", "*\shell\Erase With FileClean", "icon", "S", App.Path > & "\FileClean.exe" > fWriteValue "HKCR", "*\shell\Erase With FileClean\command", "", "S", > App.Path & "\FileClean.exe %1" > > For some reason when right clicking on an .exe the value never gets > written to the registry. Is there some part of the value %1 that I am > missing? > > Thanks, > Norm Well it appears to be working correctly after compiling, just did not want to work from IDE. I will post back if I run into other problems. Thanks, Norm
From: Mayayana on 7 May 2010 23:19 I don't think this is related to what you described, but you may want to try quotes. Assuming the path value is not an expanding string, I find it more dependable to write the value in the command key like so: "C:\program files\some Program\main.exe" "%1" rather than: C:\program files\some Program\main.exe %1 | > I have the following code to set a right click context menu in explorer | > that my program will respond to. Everything works fine, except if I right | > click on an .exe file and then left click on the context menu for my | > program. I get a message from Windows asking if I want to run the program | > and I have the option to click on OK or Cancel. So for some reason Windows | > is intercepting my right click message before it gets to my program, but | > only on .exe files. | > | > Here is the code to set the context menu: | > | > fWriteValue "HKCR", "*\shell\Erase With FileClean", "icon", "S", App.Path | > & "\FileClean.exe" | > fWriteValue "HKCR", "*\shell\Erase With FileClean\command", "", "S", | > App.Path & "\FileClean.exe %1" | > | > For some reason when right clicking on an .exe the value never gets | > written to the registry. Is there some part of the value %1 that I am | > missing? | > | > Thanks, | > Norm | | Well it appears to be working correctly after compiling, just did not want | to work from IDE. | I will post back if I run into other problems. | | Thanks, | Norm |
From: C. Kevin Provance on 7 May 2010 23:26 "Norm" <NormF4(a)spoof.com> wrote in message news:2A483E8C-9B7F-4CB8-8EF3-E585E997F790(a)microsoft.com... :I have the following code to set a right click context menu in explorer that : my program will respond to. Everything works fine, except if I right click : on an .exe file and then left click on the context menu for my program. I : get a message from Windows asking if I want to run the program and I have : the option to click on OK or Cancel. So for some reason Windows is : intercepting my right click message before it gets to my program, but only : on .exe files. : : Here is the code to set the context menu: This is something you would want to handle with your setup program. Not only is it easier, but uninstalling those keys is a breeze. If you reply on your app to do it, chances are it won't, and you'll have a dead entry in the explorer shell.
From: Norm on 8 May 2010 00:44 "C. Kevin Provance" <*@*.*> wrote in message news:uGrEG5l7KHA.420(a)TK2MSFTNGP02.phx.gbl... > > "Norm" <NormF4(a)spoof.com> wrote in message > news:2A483E8C-9B7F-4CB8-8EF3-E585E997F790(a)microsoft.com... > :I have the following code to set a right click context menu in explorer > that > : my program will respond to. Everything works fine, except if I right > click > : on an .exe file and then left click on the context menu for my program. > I > : get a message from Windows asking if I want to run the program and I > have > : the option to click on OK or Cancel. So for some reason Windows is > : intercepting my right click message before it gets to my program, but > only > : on .exe files. > : > : Here is the code to set the context menu: > > This is something you would want to handle with your setup program. Not > only is it easier, but uninstalling those keys is a breeze. If you reply > on your app to do it, chances are it won't, and you'll have a dead entry > in the explorer shell. Thanks for the information Mayayana, I will look at enclosing the app.exe and %1 in quotes, I almost have to keep the App.Path as the app may be installed anywhere. Kevin, I will look at doing that, but the reason I am doing it in the app, is so that the entries are not there if the app is not running. I can certainly include the entries in the setup marked to be removed upon uninstall. Thanks again, Norm
|
Next
|
Last
Pages: 1 2 Prev: Using Outlook Object Lib while Outlook is running Next: DLL Properties |