Page 1 of 1

Control the Start-/ Stop Capture Button by plugin

Posted: Thu Sep 02, 2010 8:37 am
by krumpc
Hi all,

I'm developing a little plugin, which analysis frames in the background, and waits for a trigger. When a trigger bangs, the plugin starts capturing frames for a defined time and should stop the record after this.

Is it anywise possible, to control the start/stop capture button in OmniPeek by the plugin?? I want to send e.g. a message from my plugin to OmniPeek, and then the button should be clicked / activated / deactivated automatically.

Any ideas??

Best Regards
Chris

RE: Control the Start-/ Stop Capture Button by plugin

Posted: Thu Sep 23, 2010 9:08 am
by Spacepacket
Hi Chris,

Yes, you can start and stop captures by pro grammatically pushing the start/stop capture button. Here is some code:

CWnd* pParent = m_Tab.GetParent();
pParent = pParent->GetParent();
pParent = pParent->GetParent();
pParent->PostMessage( WM_COMMAND, 32785 );

This code assumes you have created a tab. If you do not have a tab, the capture window handle is passed as a param to the OnCreateContext() method in the PluginCreateContextParam structure:

int
CMyPlugin::OnCreateContext(
PluginCreateContextParam* ioParams )
{
m_hCaptureWindow = (HWND) ioParams->fContextData;
//....