July 20, 2024, 06:24:12 AM


IWBasic runs in Windows 11!

Adding your program to context (Right click) menus - repost

Started by Andy, June 07, 2016, 12:26:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


This is an example of how to add a program to context (right click) menus in windows.

I've re-posted this due to the website upgrade.

How to:
1. Unzip the files.

2. Setup - you can run setup_stringmap.exe - just browse to your IWBDev / EBasic root folder in C:\Program Files and click OK.

Alternatively, if that doesn't work, copy the .lib file to your Libs folder, the .inc file to your include folder.

3. Compile "MyProg.iwb" to create an exe file

4. Amend "contextmenu.iwb"  string FullProgramPath = "C:\\win10\\MyProg.exe" to the correct path of MyProg.exe

If there are spaces in the full path name, add a <SPACE>%1 to the full path
i.e. string FullProgramPath = "C:\\win  10\\MyProg.exe %1"

5. Compile contextmenu.iwb

6. Browse to contextmenu.exe - right click and select "Run as Administrator".

If you have got everything correct, when you right click on a file / folder / drive you should see an entry called "MyProg" which will run if clicked on.

To remove the entries:
- Remove the comments for SMRegDeleteKey lines (at the end of the program) 
- Compile
- Browse to contextmenu.exe and run as Admin again.

By changing the strings:
MyProgramName and FullProgramPath you can add in any program to the context menus.

Comment out again the SMRegDeleteKey lines if you want to try it on one of your own programs - if you don't, the entries will be created and then deleted and you'll think this program does not work!

Always run contextmenu.exe as Admin (i.e. right click, Run as Admin).

Note - This program I've written also shows you where to look when, over time, you want to remove a context entry for something you don't want there.

Attached are the files.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.