Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8233749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:14:14+00:00 2026-06-07T18:14:14+00:00

I currently have a resource light unmanaged Windows C++ application using: CreateMutex to ensure

  • 0

I currently have a resource light “unmanaged” Windows C++ application using:

  • CreateMutex to ensure there is at most a single instance of the application.

  • COPYDATASTRUCT to pass command line parameters over to that single instance, should another instance attempt to start (after sending data, it will then quit).

The use case is a simple one: launch a new application instance to open a file specified on the command line, or otherwise open the file in a previously-launched application instance.

How could I achieve the same behaviour in a Haskell program?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T18:14:15+00:00Added an answer on June 7, 2026 at 6:14 pm

    It looks like CreateMutex isn’t offered in the Win32 package that comes with GHC. You’ll need to either bind to it yourself using the FFI or emulate it in a cross-platform way. One trick commonly used on Linux is to choose a particular filename to act as the “mutex”; if it doesn’t exist, you create it and write down how to contact you then delete it when you exit, while if it does, you read the contact information out of it to find out how to connect to the already running process. This approach does have downsides: if either your app or the computer as a whole goes down, you’ll have stale contact information.

    For IPC, I think there’s a number of cross-platform interfaces. Wikipedia has an excellent list; especially suitable for doing this task in Haskell are sockets, (named) pipes, and dbus. For the latter two, you may need Cygwin, since they ultimately depend on getting the unix package installed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have couple resource DLLs that I currently load when application starts using following
I'm working on a relatively simple website with (currently) a single resource. I have
I currently have a project for data storage records. There is a nested resource,
I currently have this code that creates 4 tabs using tabactivity: public class toknapp
I currently have a resource-file where I store errormessages. And I would like to
I currently have a C# Web Application Project with a multitude of pages as
I have a resource (.resx) file, and it have currently 58 string properties. This
I have some resource files that are in the classpath of my web application
I'm developing a web application and I currently have the following ACL assigned to
I am using Mvvm-Light and have been ignoring how binding in XAML really works

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.