I have written a small radio application as my radio is not supported in Road Runner.
In my code I have the ability to detect when the system wakes, from hibernation or suspend, and reinitialise my radio. It works when the application is not launched via RR.
When the application is run through RR it does not receive the windows message and subsequently does not work.
Am I right in assuming that child processes, such as those launched from RR, do not receive the WM_POWERBROADCAST message? Or should it?
Unfortunately I have little time, as we all do, developing and tweaking my Car PC, it is left to the spare time I have on weekends and after work. I will investigate my problems more next weekend and let you know of my findings however if anyone knows of this issue please let me know.
This is the code in my application that handles windows messages, not that it will probably help much.
I catch the WM_POWERBROADCAST message and only run the code when the PBT_APMRESUMESUSPEND event occurs, this is sent when the system resumes from hibernation/suspend (NOTE: Code is in Borland C++):
This the code in my application:
Code:
void __fastcall TfrmMain::WndProc(Messages::TMessage &Message)
{
bool Handled = false;
if ((Message.Msg == WM_POWERBROADCAST) && (Message.WParam == PBT_APMRESUMESUSPEND))
{
//must reinitialise the FM Radio
fine_tuning_mode = false;
active_button = 0;
//detect and enable radio
tmrOpen->Enabled = true;
Handled = true;
}
if(!Handled)
TForm::WndProc(Message);
}
Also the radio I am using is an AverMedia FM Radio. There is a project on sourceforge that has reverse engineered some of the control codes from this radio which is what forms the basis of my applicaiton. Idealy this radio would be supported by RR however I think this may be a long way off.
Bookmarks