This is less of a question and more of a tip for people running Vista and XP (possibly older versions), so apologies if I've posted this in the wrong location!
To cancel the autoplay facility in Windows (tested in Vista, but I believe it also works in XP), you must first override the MSWWindowProc function in a class derived from wxWindow (a wxFrame is a good choice). You then register for the QueryCancelAutoplay message and handle it accordingly. For example:
Code: Select all
WXLRESULT MyFrame::MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
{
static WXLRESULT ALLOW_AUOTRUN = 0;
static WXLRESULT CANCEL_AUOTRUN = 1;
static WXUINT QUERYCANCELAUTORUN_MESSAGE_ID = RegisterWindowMessage("QueryCancelAutoplay");
if (message == QUERYCANCELAUTORUN_MESSAGE_ID)
{
return CANCEL_AUOTRUN;
}
// must propagate all other messages
return wxFrame::MSWWindowProc(message, wParam, lParam);
}
It's taken me quite a long time to find this, so hopefully it will save someone else a lot of google'ing!
Cheers,
Gian