<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>keeping the window focus</title>
		<link>http://www.allegro.cc/forums/view/585575</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Fri, 26 May 2006 03:33:16 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello,</p><p>I have yet another win32 question (this isn&#39;t allegro related, but i guess it could be)<br />Anyway, I have a program that uses windows hooks to catch mouse events, and sends them over a socket connection. When it runs, it runs without a window, therefore, you cant switch focus to it. Because it cant get focus, the program only sends the data when mouse movements/clicks happen on the desktop. How can I make it so that no matter what, it will send all mouse movements? </p><p>thanx.</p><p>P.S. I know that all events are being captured because a log file the program creates while it runs confirms this. Its just that the data isnt being transmitted over the network.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (KaBlammyman)</author>
		<pubDate>Wed, 24 May 2006 03:05:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>then the program is broken.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (A J)</author>
		<pubDate>Wed, 24 May 2006 05:46:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>uummm no.::)</p><p>I works fine when th window has focus. How do I know? Because I can have it start with or without a window via a text file. When the visible window has focus, it works fine. Maybe it doesn&#39;t need a visible window or window focus to work, but that was what I am guessing since it works fine when the window is visible and does have focus.</p><p> I just need it to do what it has to do, even when other programs have the window focus.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (KaBlammyman)</author>
		<pubDate>Thu, 25 May 2006 01:23:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>i dont know if this will work but it might.</p><div class="source-code snippet"><div class="inner"><pre> <a href="http://www.allegro.cc/manual/set_display_switch_mode" target="_blank"><span class="a">set_display_switch_mode</span></a><span class="k2">(</span>SWITCH_BACKGROUND<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

what this does is stops your program from &quot;pausing&quot; when its not the active window...</p><p>EDIT: here is the page describing it <a href="http://www.allegro.cc/manual/api/graphics-modes/set_display_switch_mode">http://www.allegro.cc/manual/api/graphics-modes/set_display_switch_mode</a>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (adamk kromm)</author>
		<pubDate>Thu, 25 May 2006 11:53:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sounds like it needs a window to capture mouse events.<br />Therefore it does not perform the task you want, so either its not suitable, or if you claim its supposed to be, then its broken.</p><p>Have you read all the requirements of the window hooks functions on MSDN ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (A J)</author>
		<pubDate>Thu, 25 May 2006 15:40:49 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The hook part works fine (my log file shows e that everything is cought)...its the auctual sending of data that doesnt work without widnow focus.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (KaBlammyman)</author>
		<pubDate>Fri, 26 May 2006 01:14:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Did you try set_switch_display_mode?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Synapse Jumps)</author>
		<pubDate>Fri, 26 May 2006 02:17:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>that doesn&#39;t make any sense,  sending network data has absolutely zero to do with windows/focus.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (A J)</author>
		<pubDate>Fri, 26 May 2006 03:09:54 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The only things set_display_switch_mode affects (aside from possibly some graphics driver adjustments) are timer interrupts: Allegro doesn&#39;t send them when the window doesn&#39;t have focus. Other timing methods work normally.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Fri, 26 May 2006 03:12:45 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
that doesn&#39;t make any sense, sending network data has absolutely zero to do with windows/focus.
</p></div></div><p>

thats what I thought...but unless the window has focus, the data wont be sent. I telnet&#39;ed (since the final product will communicate with telnet) to myself, so thats how i can tell if the data is being sent or not. </p><p><b>update</b> if the mouse is over the window, it will send data...even if it isn&#39;t the top window/focused window.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (KaBlammyman)</author>
		<pubDate>Fri, 26 May 2006 03:33:16 +0000</pubDate>
	</item>
</rss>
