I have imported the kernel32 library. So, I have the createMutex function available but I am not quite sure of the various parameters and return values.
This is classic Visual Basic, not Visual Basic.NET but I can probably work with either language in the form of an answer.
The VB code looks something like this:
The first parameter is a pointer to an
SECURITY_ATTRIBUTESstructure. If you don’t know what it is, you don’t need it. Pass NULL (0).The second parameter is
TRUE(non-zero, or 1) if the calling thread should take ownership of the mutex.FALSEotherwise.The third parameter is the mutex name and may be NULL (0), as shown. If you need a named mutex, pass the name (anything unique) in. Not sure whether the
VBwrapper marshals the length-prefixedVBstring type (BSTR) over to a null-terminated Ascii/Unicode string if not, you’ll need to do that and numerous examples are out there.Good luck!