<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Kinovea - Forums — python 3.13 call to: "Kinovea:DualCapture.ToggleRecording"]]></title>
		<link>https://www.kinovea.org/en/forum/viewtopic.php?id=2103</link>
		<atom:link href="https://www.kinovea.org/en/forum/extern.php?action=feed&amp;tid=2103&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in python 3.13 call to: "Kinovea:DualCapture.ToggleRecording".]]></description>
		<lastBuildDate>Sun, 15 Jun 2025 12:14:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: python 3.13 call to: "Kinovea:DualCapture.ToggleRecording"]]></title>
			<link>https://www.kinovea.org/en/forum/viewtopic.php?pid=6848#p6848</link>
			<description><![CDATA[<p>(offtopic) but hrynkiw30 thank you! I have spent the last few days trying to make vb.net or c#.net send commands and kept getting errors in the log. <br />27256 - DEBUG - [Main] - KinoveaMainWindow - Received WM_COPYDATA.<br />27256 - ERROR - [Main] - KinoveaMainWindow - Unrecognized command.</p><p>With reviewing your code I now have a working copy of both c# and vb.net. THANK YOU!</p>]]></description>
			<author><![CDATA[null@example.com (JamesS)]]></author>
			<pubDate>Sun, 15 Jun 2025 12:14:33 +0000</pubDate>
			<guid>https://www.kinovea.org/en/forum/viewtopic.php?pid=6848#p6848</guid>
		</item>
		<item>
			<title><![CDATA[Re: python 3.13 call to: "Kinovea:DualCapture.ToggleRecording"]]></title>
			<link>https://www.kinovea.org/en/forum/viewtopic.php?pid=6840#p6840</link>
			<description><![CDATA[<p>Hi, <br />Unfortunately there is a bug with dual recording commands in the released version. The ones for single capture screen should work, can you confirm that? This script seems massively useful. </p><p>I fixed the issue in the source code a while back but haven&#039;t made progress on the other things I wanted to include in the next release.</p>]]></description>
			<author><![CDATA[null@example.com (joan)]]></author>
			<pubDate>Wed, 11 Jun 2025 10:39:41 +0000</pubDate>
			<guid>https://www.kinovea.org/en/forum/viewtopic.php?pid=6840#p6840</guid>
		</item>
		<item>
			<title><![CDATA[python 3.13 call to: "Kinovea:DualCapture.ToggleRecording"]]></title>
			<link>https://www.kinovea.org/en/forum/viewtopic.php?pid=6823#p6823</link>
			<description><![CDATA[<p>My script:&quot;<br />import ctypes<br />import ctypes.wintypes as wintypes<br />import win32gui</p><p>WM_COPYDATA = 0x004A</p><p>class COPYDATASTRUCT(ctypes.Structure):<br />&nbsp; &nbsp; _fields_ = [<br />&nbsp; &nbsp; &nbsp; &nbsp; (&quot;dwData&quot;, wintypes.LPARAM),<br />&nbsp; &nbsp; &nbsp; &nbsp; (&quot;cbData&quot;, wintypes.DWORD),<br />&nbsp; &nbsp; &nbsp; &nbsp; (&quot;lpData&quot;, wintypes.LPCVOID),<br />&nbsp; &nbsp; ]</p><p>def send_command_to_kinovea(command_string):<br />&nbsp; &nbsp; hwnd = win32gui.FindWindow(None, &quot;Kinovea [Record]&quot;)&nbsp; # Adjust title as needed<br />&nbsp; &nbsp; if not hwnd:<br />&nbsp; &nbsp; &nbsp; &nbsp; print(&quot;Kinovea window not found.&quot;)<br />&nbsp; &nbsp; &nbsp; &nbsp; return False</p><p>&nbsp; &nbsp; encoded = command_string.encode(&quot;utf-8&quot;)<br />&nbsp; &nbsp; buffer = ctypes.create_string_buffer(encoded + b&quot;\0&quot;)<br />&nbsp; &nbsp; cds = COPYDATASTRUCT()<br />&nbsp; &nbsp; cds.dwData = 0<br />&nbsp; &nbsp; cds.cbData = len(buffer)<br />&nbsp; &nbsp; cds.lpData = ctypes.cast(buffer, wintypes.LPCVOID)</p><p>&nbsp; &nbsp; result = ctypes.windll.user32.SendMessageW(<br />&nbsp; &nbsp; &nbsp; &nbsp; hwnd,<br />&nbsp; &nbsp; &nbsp; &nbsp; WM_COPYDATA,<br />&nbsp; &nbsp; &nbsp; &nbsp; 0,<br />&nbsp; &nbsp; &nbsp; &nbsp; ctypes.byref(cds)<br />&nbsp; &nbsp; )</p><p>&nbsp; &nbsp; print(f&quot;Sent command &#039;{command_string}&#039; to Kinovea. Result: {result}&quot;)<br />&nbsp; &nbsp; return True</p><p>send_command_to_kinovea(&quot;Kinovea:DualCapture.ToggleRecording&quot;)<br />&quot;<br />Returns<br />C:\Users\wrink&gt;python togglerecordkinovea.py<br />Sent command &#039;Kinovea:DualCapture.ToggleRecording&#039; to Kinovea. Result: 0</p><p>However no recording is triggered. I can trigger the recording with the keyboard shortcut under preferences however. Im hoping to automate the trigger base on a tracable software event.</p>]]></description>
			<author><![CDATA[null@example.com (hrynkiw30)]]></author>
			<pubDate>Mon, 02 Jun 2025 09:30:58 +0000</pubDate>
			<guid>https://www.kinovea.org/en/forum/viewtopic.php?pid=6823#p6823</guid>
		</item>
	</channel>
</rss>
