Feature Request: Customizable File Associations & “Open with Code Writer” Integration

Code Writer App Suggestions and Support Forum

The latest build of this product (v4.2.42) was released 5 years ago, which was before this thread was created.
Posted 2 months ago by Don Mega
Avatar

## Summary

This request proposes a small set of targeted changes that would significantly improve Code Writer’s integration with Windows and modern developer workflows.

The primary goal is **not** to make Code Writer the default editor, but to ensure it can be invoked **reliably and intentionally** from the Windows shell for *any file type*, in a manner consistent with developer expectations.

---

## #1 Recommendation (Primary):

### Add “Open with Code Writer” as a Context Menu Option for All File Types

### What is being requested

Provide a first-class, supported way for users to:

> Right-click **any file** → **Open with Code Writer**

This should work regardless of file extension, without requiring:

* File association changes
* Registry hacks
* UI automation
* Default editor changes

---

### Why this should be the top priority

Developers rarely want to globally associate file extensions.
What they want is **intentional, ad-hoc editing**:

* Inspect a config file
* Open an unfamiliar file type
* Quickly view generated output
* Edit a script without changing defaults

Every mainstream editor supports this workflow.

---

### Why current behavior blocks this workflow

Currently:

* Code Writer appears in some “Open with” lists
* But file activation is not handled
* Resulting in the app opening and immediately closing, or opening without the file

This breaks user trust and makes Code Writer feel unreliable in shell workflows.

---

### How this can be implemented (minimal change)

The most robust approach is:

* Register Code Writer as a **generic “Open with” handler**
* Accept files via standard Windows activation (see Recommendation #3)
* Do **not** auto-associate extensions

This enables:

* Explorer → context menu → Code Writer
* Scripted launches using file paths
* No default editor disruption

---

### Developer workflows enabled

* Right-click any file → Open with Code Writer
* Use Code Writer as a secondary editor
* Zero setup, zero configuration
* Works for unknown or custom extensions

This single change would dramatically increase usability.

---

## #2 Recommendation: Improve `codewriter:` Protocol Handling

### What is being requested

Enhance the existing protocol handler so it can accept file payloads:

```text
codewriter://open?file=C:\path\file.ext
```

or:

```text
codewriter:C:\path\file.ext
```

---

### Why this is valuable

Protocol handling enables:

* Script-based invocation
* Deep linking from tools or documentation
* Cross-app workflows

It also provides a **fallback activation path** when Explorer is not involved.

---

### Why this is #2, not #1

While useful:

* Explorer does not use protocols for file opening
* Protocols cannot replace shell integration
* This is complementary, not foundational

Still, improving protocol handling is a **low-effort, high-utility enhancement**.

---

## #3 Recommendation: Implement `OnFileActivated`

### What is being requested

Implement standard UWP file activation handling:

```csharp
protected override void OnFileActivated(FileActivatedEventArgs args)
```

---

### Why this is required (even if not exposed directly)

This is the **core plumbing** that enables:

* “Open with” functionality
* Context menu integration
* Default app support (optional)
* Reliable file delivery to the app

Without this method:

* Windows launches the app
* But cannot deliver the file
* Resulting in immediate app exit or empty startup

---

### Why this is #3 in the list

While technically foundational, developers experience it indirectly.

From a user’s perspective:

* They want “Open with Code Writer” to work
* They don’t care how activation is implemented

However, **this method is required** to make #1 and #2 work correctly.

---

## Why AppX ProgID Should Be Used for File Associations

### The problem with classic ProgIDs

Classic ProgIDs (`txtfile`, etc.):

* Are designed for Win32 apps
* Cannot activate UWP apps correctly
* Bypass the UWP activation model

Using them leads to:

* Silent failures
* Ignored file payloads
* Inconsistent shell behavior

---

### Why AppX ProgIDs are the correct mechanism

AppX ProgIDs:

* Are explicitly designed for Store apps
* Allow Windows to route activation correctly
* Integrate with Explorer, Open With, and Defaults
* Respect UWP security boundaries

They are required for:

* Reliable file activation
* Custom file association UI
* Default app management

---

### How this supports customizable file associations

With a proper AppX ProgID:

* Code Writer can appear in “Open with” consistently
* Users can opt-in per extension
* Extensions can be added without registry hacks
* The app behaves predictably in all shell contexts

This enables **user-controlled, explicit association**, which is ideal for a code editor.

---

## Why This Enhances the Product

### From a developer’s perspective

* Code Writer becomes usable in real workflows
* It behaves like a modern editor
* It integrates naturally with Windows
* It does not force defaults or intrusive changes

---

### From a product perspective

* Minimal engineering effort
* Major usability gain
* Reduced support friction
* Better parity with free competitors
* Stronger positioning as a developer tool

---

## Final Recommendation Summary

1. **Add “Open with Code Writer” for all file types**
→ Highest impact, most visible improvement

2. **Enhance `codewriter:` protocol handling**
→ Enables scripting and deep linking

3. **Implement `OnFileActivated`**
→ Required plumbing for reliable activation

4. **Use AppX ProgID for file associations**
→ Enables customizable, supported Windows integration

---

## Closing Note

This request is not about changing Code Writer’s identity or UI.

It is about:

* Respecting Windows activation contracts
* Meeting developer expectations
* Unlocking workflows that already exist in the editor

Any/all/some of these changes would make Code Writer **significantly more usable without increasing complexity**.

Comments (1)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Thank you for providing the details on your requests. We agree with them, but unfortunately our hands are tied due to the security limitations caused by Microsoft's sandboxing of UWP applications.

1) Context menu option to open any file - There is not supported in a UWP application, and we wish it was. All we can do is pick specific common file extensions and explicitly state at app compile time that they can be opened in Code Writer, which is called creating a file type association.

2) Allow the codewriter protocol to open files - It does support a file opening syntax already. The issue is that due to security restrictions in UWP apps, we can only open a file that was recently opened in the app via a picker selection. The Documentation's subsection on security in the Protocol Activation section describes this limitation. There appears to be no way around it, and is something we've looked into many times.

3) Implement OnFileActivated - We actually do already handle OnFileActivated and try to open the files passed in. However I suspect that if you are running into issues with this, it's the same thing as #2 where UWP security is blocking it unless a file was recently opened in the app with a picker.

4) AppX ProgID for file associations - This is not supported in pure UWP applications like Code Writer.

We are happy to discuss any specific web pages that describe how to work around these limitations in a pure UWP app like Code Writer, however we have researched them many times and don't believe there's any workarounds for this scenario.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.