Clarification:  You need to test the loword of the wParam for WA_CLICKACTIVE, not wParam itself.<div><br><br><div class="gmail_quote">On 16 September 2011 11:46, Jolyon Smith <span dir="ltr">&lt;<a href="mailto:jsmith@deltics.co.nz">jsmith@deltics.co.nz</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Just to be strictly accurate, &quot;Focus&quot; is a keyboard concept.  Mouse events do not have a &quot;Focus&quot; context, but applications do have the concept of &quot;active window&quot;, which applies to top level windows only.<div>

<br></div><div>If this behaviour is important to you then the wParam of the WM_ACTIVATE indicates how a window became activated:<br><br><a href="http://msdn.microsoft.com/en-us/library/ms646274(v=vs.85).aspx" target="_blank">http://msdn.microsoft.com/en-us/library/ms646274(v=vs.85).aspx</a></div>

<div><br></div><div>You could implement a WM_ACTIVATE handler on your application form call inherited first to get the default message handling, and then if wParam is WA_CLICKACTIVE you could lookup the control at the mouse position and send it a WM_LBUTTONDOWN message, effectively resurrecting and forwarding the mouse button message that was consumed and transformed into the ACTIVATE message.<br>

<br>I have no idea whether that would actually work but it could be fun to try it.</div><div><br></div><div>:)</div><div><div></div><div class="h5"><div><br></div><div><br></div><div><div><br><div><div><div class="gmail_quote">
On 16 September 2011 11:10, Geoff &amp; Jacquie <span dir="ltr">&lt;<a href="mailto:geoff@statesoft.co.nz" target="_blank">geoff@statesoft.co.nz</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">









<div lang="EN-GB" link="blue" vlink="purple">

<div>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">I have noticed the same behaviour using a
mouse and decided it is normal for windows apps. If the form doesn’t have
focus then why would it process the button event? I think the first event on an
unfocussed form or app probably sets the focus and is then discarded. This
behaviour is different in a browser window as you note.<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy">As for type of control, while my browser
has focus, no menus, buttons, put-cursor-here-click, on this Outlook message
window results in the action obtained when clicked “while using Outlook”.
I have to click again.<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>

<div>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Geoff &amp; Jacquie
Jenkins, State Electronics,<u></u><u></u></span></font></p>

<p class="MsoNormal"><b><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy;font-weight:bold">1576
Weranui Road<br>
RD 1<br>
Silverdale 0994<u></u><u></u></span></font></b></p>

<p class="MsoNormal"><font size="1" color="#990000" face="Arial"><span lang="EN-US" style="font-size:9.0pt;font-family:Arial;color:#990000">Ph 09 9581000</span></font><b><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy;font-weight:bold"> <u></u><u></u></span></font></b></p>



<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span lang="EN-US" style="font-size:10.0pt;font-family:Arial;color:navy">Computer software
development professionals, web development amateur<br>
Computers &amp; Peripherals sales and service. <br>
Linksys Partner VAR - Business Systems, LVS (VOIP) &amp; Linksys One<u></u><u></u></span></font></p>

</div>

<p class="MsoNormal"><font size="2" color="navy" face="Arial"><span style="font-size:10.0pt;font-family:Arial;color:navy"><u></u> <u></u></span></font></p>

<div>

<div class="MsoNormal" align="center" style="text-align:center"><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;">

<hr size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma;font-weight:bold">From:</span></font></b><font size="2" face="Tahoma"><span lang="EN-US" style="font-size:10.0pt;font-family:Tahoma">
<a href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a>
[mailto:<a href="mailto:delphi-bounces@listserver.123.net.nz" target="_blank">delphi-bounces@listserver.123.net.nz</a>] <b><span style="font-weight:bold">On
Behalf Of </span></b>John Bird<br>
<b><span style="font-weight:bold">Sent:</span></b> Friday, 16 September 2011
3:06 a.m.</span></font></p><div><font size="2" face="Tahoma"><br>
<b><span style="font-weight:bold">To:</span></b> NZ Borland Developers Group -
Delphi List<br>
</font></div><font size="2" face="Tahoma"><b><span style="font-weight:bold">Subject:</span></b> Re: [DUG] Form activation
/ Mouse click</font><font size="3" face="Times New Roman"><span lang="EN-US" style="font-size:12.0pt;font-family:&quot;Times New Roman&quot;"><u></u><u></u></span></font><p></p>

</div><div><div></div><div>

<p class="MsoNormal"><font size="2" face="Calibri"><span style="font-size:11.0pt"><u></u> <u></u></span></font></p>

<div>

<div>

<div>

<p class="MsoNormal"><font size="2" color="black" face="Arial"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Arial;color:black">That might be a Windows
issue?  I have seen other programs where clicking  a button in
a  non-focussed app does not click the button, and some where it
does.  Eg Windows Mail clicking send receive does activate the form but
does not click the Send Receive button.  However a Firefox Refresh button
will activate even if the Firefox Window does not have focus....<u></u><u></u></span></font></p>

</div>

<div>

<p class="MsoNormal"><font size="2" color="black" face="Arial"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Arial;color:black"> <u></u><u></u></span></font></p>

</div>

<div>

<p class="MsoNormal"><font size="2" color="black" face="Arial"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Arial;color:black">I suspect its the type
of control – maybe Toolbar buttons or Speedbuttons do and others do not
for instance? (guessing)<u></u><u></u></span></font></p>

</div>

<div>

<p class="MsoNormal"><font size="2" color="black" face="Arial"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Arial;color:black"> <u></u><u></u></span></font></p>

</div>

<div>

<p class="MsoNormal"><font size="2" color="black" face="Arial"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Arial;color:black">John Bird<br>
JBCL<br>
Contact:<br>
<a href="mailto:johnkbird@paradise.net.nz" target="_blank">johnkbird@paradise.net.nz</a><br>
<a href="mailto:jbclnz@xtra.co.nz" target="_blank">jbclnz@xtra.co.nz</a><br>
(027 4844528)<br>
<a href="http://www.jbcl.co.nz" target="_blank">http://www.jbcl.co.nz</a><br>
<a href="http://jbclnz.googlepages.com" target="_blank">http://jbclnz.googlepages.com</a><u></u><u></u></span></font></p>

</div>

<div>

<div>

<div>

<p class="MsoNormal"><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black"> <u></u><u></u></span></font></p>

</div>

<div>

<div>

<p class="MsoNormal" style="background:whitesmoke"><b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black;font-weight:bold">From:</span></font></b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black"> <a href="mailto:ross@stationplaylist.com" title="ross@stationplaylist.com" target="_blank">Ross Levis</a> <u></u><u></u></span></font></p>



</div>

<div>

<p class="MsoNormal" style="background:whitesmoke"><b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black;font-weight:bold">Sent:</span></font></b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black"> Thursday, September 15, 2011 2:32 AM<u></u><u></u></span></font></p>



</div>

<div>

<p class="MsoNormal" style="background:whitesmoke"><b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black;font-weight:bold">To:</span></font></b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black"> <a href="mailto:delphi@delphi.org.nz" title="delphi@delphi.org.nz" target="_blank">&#39;NZ
Borland Developers Group - Delphi List&#39;</a> <u></u><u></u></span></font></p>

</div>

<div>

<p class="MsoNormal" style="background:whitesmoke"><b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black;font-weight:bold">Subject:</span></font></b><font size="2" color="black" face="Tahoma"><span lang="EN-NZ" style="font-size:10.0pt;font-family:Tahoma;color:black"> [DUG] Form activation / Mouse click<u></u><u></u></span></font></p>



</div>

</div>

</div>

<div>

<p class="MsoNormal"><font size="3" color="black" face="Calibri"><span lang="EN-NZ" style="font-size:12.0pt;color:black"> <u></u><u></u></span></font></p>

</div>

</div>

<div>

<p class="MsoNormal"><font size="3" color="#1f497d" face="Calibri"><span lang="EN-NZ" style="font-size:12.0pt;color:#1F497D">In my D7 app it is possible to have 2
non-modal forms on the screen with buttons on each.  A customer who has a
touch screen says when he touches a button on the form that doesn’t
currently have the focus, the button doesn’t get clicked.  First
touch only activates the form and a 2<sup>nd</sup> touch is required.<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" color="black" face="Calibri"><span lang="EN-NZ" style="font-size:11.0pt;color:black"> </span></font><font size="3" color="#1f497d"><span lang="EN-NZ" style="font-size:12.0pt;color:#1F497D"><u></u><u></u></span></font></p>



<p class="MsoNormal"><font size="3" color="#1f497d" face="Calibri"><span lang="EN-NZ" style="font-size:12.0pt;color:#1F497D">Anyone know why that would be? I would
have thought a touch on a screen touch was identical as clicking with a mouse.<u></u><u></u></span></font></p>

<p class="MsoNormal"><font size="2" color="black" face="Calibri"><span lang="EN-NZ" style="font-size:11.0pt;color:black"> </span></font><font size="3" color="#1f497d"><span lang="EN-NZ" style="font-size:12.0pt;color:#1F497D"><u></u><u></u></span></font></p>



<p class="MsoNormal"><font size="3" color="#1f497d" face="Calibri"><span lang="EN-NZ" style="font-size:12.0pt;color:#1F497D">Cheers,<br>
Ross.<u></u><u></u></span></font></p>

<div class="MsoNormal" align="center" style="text-align:center"><font size="3" color="black" face="Calibri"><span lang="EN-NZ" style="font-size:12.0pt;color:black">

<hr size="2" width="100%" align="center">

</span></font></div>

<p class="MsoNormal"><font size="3" color="black" face="Calibri"><span lang="EN-NZ" style="font-size:12.0pt;color:black">_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with
Subject: unsubscribe<u></u><u></u></span></font></p>

</div>

</div>

</div>

</div></div></div>

</div>


<br>_______________________________________________<br>
NZ Borland Developers Group - Delphi mailing list<br>
Post: <a href="mailto:delphi@listserver.123.net.nz" target="_blank">delphi@listserver.123.net.nz</a><br>
Admin: <a href="http://delphi.org.nz/mailman/listinfo/delphi" target="_blank">http://delphi.org.nz/mailman/listinfo/delphi</a><br>
Unsubscribe: send an email to <a href="mailto:delphi-request@listserver.123.net.nz" target="_blank">delphi-request@listserver.123.net.nz</a> with Subject: unsubscribe<br></blockquote></div><br></div></div></div></div>
</div></div></blockquote></div><br></div>