ChromeCast-Desktop-Audio-Streamer icon indicating copy to clipboard operation
ChromeCast-Desktop-Audio-Streamer copied to clipboard

Use SendMessage(wm_Quit) to close

Open Alucard712 opened this issue 6 months ago • 3 comments

I use the streamer as a helper app for a windows program I develop myself. When my program is started the streamer is started by it in the background and upon closing the streamer is closed, too:

//start
ShellExecute(0, 'open', GetQuotedChar(StreamerExe), nil, nil, sw_Hide);
//close
SendMessage(StreamerHandle, wm_Close, 0, 0);

Starting is working well, but closing has some issues. I want to use the “Minimize to tray when closing” setting of the streamer, but this (obviously) causes my close command to “fail”. I could use taskkill to force closing of the streamer, but this prevents “Auto-mute/unmute desktop audio” from working (again, no surprise…).

Would it be possible that the streamer reacts to wm_Quit to be closed? Any ideas?

Alucard712 avatar Jun 09 '25 09:06 Alucard712

So, you recommend that I plainly taskkill the streamer and take care of the un-muting of my machine afterwards myself?

Alucard712 avatar Jun 10 '25 17:06 Alucard712

I can't think of another solution.

I don't think it's possible to catch WM_QUIT, because the message loop is in a .Net dll (here in code).

If there's a way to change the logic of the WM_CLOSE behaviour that works for you then let it know! (here in code)

SamDel avatar Jun 10 '25 20:06 SamDel