One way is to use CreateMutex.
#include <windows.h>
/* In real code, this should be a unique identifier */
#define MUTEX_NAME "MYPROGRAM"
int main(void)
{
CreateMutex(NULL, FALSE, MUTEX_NAME);
if (GetLastError() != 0) {
/* Instance of this program is already running */
return EXIT_FAILURE;
}
/* ... */