<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: mouse cursor control in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790067#M32142</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;WM_SETCURSOR is the brother of WM_MOUSEMOVE (I'm not sure exactly where it's generated, but they should arrive one after another instantly). The explanation, thus, appears to be that you don't get WM_MOUSEMOVE when the mouse leaves your window quickly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Now, how to solve it depends on your window parent/child hierarchy... let's see... &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;QUOTE from="" wm_setcursor=""&gt;&lt;/QUOTE&gt;&lt;/DIV&gt;
&lt;DIV&gt;The DefWindowProc function passes the WM_SETCURSOR message to a parent window before processing. If the parent window returns TRUE, further processing is halted. Passing the message to a window's parent window gives the parent window control over the cursor's setting in a child window. The DefWindowProc function also uses this message to set the cursor to an arrow if it is not in the client area, or to the registered class cursor if it is in the client area. &lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Does it explain the behaviour? &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 21 Jul 2004 17:09:13 GMT</pubDate>
    <dc:creator>Jugoslav_Dujic</dc:creator>
    <dc:date>2004-07-21T17:09:13Z</dc:date>
    <item>
      <title>mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790065#M32140</link>
      <description>&lt;DIV&gt;When a user takes the mouse cursor into a region of the screen defined by cx1,cy1,cx2,cy2 I am successfully getting the cursor to change to something other than the default. When it moves out of this region it changes back to the default. I'm using:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt; case(WM_SETCURSOR)&lt;/DIV&gt;
&lt;DIV&gt; if(xpos&amp;lt;=cx1.or.xpos&amp;gt;=cx2.or.ypos&amp;lt;=cy1.or.ypos&amp;gt;-cy2)then&lt;/DIV&gt;
&lt;DIV&gt; iret = SetCursor(hcursor_default)&lt;/DIV&gt;
&lt;DIV&gt; else&lt;/DIV&gt;
&lt;DIV&gt; iret = SetCursor(hcursor)&lt;/DIV&gt;
&lt;DIV&gt; end if&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;This works fine until the cursor is moved quickly over the toolbar. There's no problem if I move it nice and slowly, but move it quickly and it will not change.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Please can someone suggest what's going on here?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;With many thanks in advance,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Mike&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Jul 2004 10:11:47 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790065#M32140</guid>
      <dc:creator>michael_green</dc:creator>
      <dc:date>2004-07-21T10:11:47Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790066#M32141</link>
      <description>&lt;DIV&gt;WM_SETCURSOR is the brother of WM_MOUSEMOVE (I'm not sure exactly where it's generated, but they should arrive one after another instantly). The explanation, thus, appears to be that you don't get WM_MOUSEMOVE when the mouse leaves your window quickly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Now, how to solve it depends on your window parent/child hierarchy... let's see... &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;QUOTE from="" wm_setcursor=""&gt;&lt;/QUOTE&gt;&lt;/DIV&gt;
&lt;DIV&gt;The DefWindowProc function passes the WM_SETCURSOR message to a parent window before processing. If the parent window returns TRUE, further processing is halted. Passing the message to a window's parent window gives the parent window control over the cursor's setting in a child window. The DefWindowProc function also uses this message to set the cursor to an arrow if it is not in the client area, or to the registered class cursor if it is in the client area. &lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Does it explain the behaviour? &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Jul 2004 17:07:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790066#M32141</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-07-21T17:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790067#M32142</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;WM_SETCURSOR is the brother of WM_MOUSEMOVE (I'm not sure exactly where it's generated, but they should arrive one after another instantly). The explanation, thus, appears to be that you don't get WM_MOUSEMOVE when the mouse leaves your window quickly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Now, how to solve it depends on your window parent/child hierarchy... let's see... &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;QUOTE from="" wm_setcursor=""&gt;&lt;/QUOTE&gt;&lt;/DIV&gt;
&lt;DIV&gt;The DefWindowProc function passes the WM_SETCURSOR message to a parent window before processing. If the parent window returns TRUE, further processing is halted. Passing the message to a window's parent window gives the parent window control over the cursor's setting in a child window. The DefWindowProc function also uses this message to set the cursor to an arrow if it is not in the client area, or to the registered class cursor if it is in the client area. &lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Does it explain the behaviour? &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 21 Jul 2004 17:09:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790067#M32142</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-07-21T17:09:13Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790068#M32143</link>
      <description>&lt;DIV&gt;Thanks Jugoslav. It kind of helps to explain what's going on, but I don't really know what to do about it. Do I have to set up a message processing loop for the child window (the toolbar)? I haven't a clue how to do that if that's the case. Please, if possible, could you outline the steps I need to take?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;With many thanks&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Mike&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Jul 2004 12:41:58 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790068#M32143</guid>
      <dc:creator>michael_green</dc:creator>
      <dc:date>2004-07-22T12:41:58Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790069#M32144</link>
      <description>&lt;DIV&gt;But, are your window and the toolbar a parent and a child or siblings?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;If they're parent and child, you're &lt;EM&gt;supposed &lt;/EM&gt;(at least, according to docs I quoted above, and a quick test confirms that's the case)to get WM_SETCURSOR message in the parent even when the mouse is over the toolbar.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;If they're siblings, you can probably solve the problem by moving WM_SETCURSOR processing to the window procedure of their common parent. (You can hit-test the mouse position usingwParam -&amp;gt; MapWindowPoints).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yet, I can't fully explain the effect you're observing. There's a lot of ping-pong involved with passing the message around... Can you check with Spy++ what is going on with WM_SETCURSOR for the toolbar &amp;amp; parent (note: wParam is handle of the window containing the mouse, which is in general not identical with hWnd -- wParam can be hWnd's child).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 22 Jul 2004 14:59:57 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790069#M32144</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-07-22T14:59:57Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790070#M32145</link>
      <description>&lt;DIV&gt;Hi Jugoslav,&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yes, the toolbar is a child of the main window.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;It seems to be the WM_MOUSEMOVE message that's not being processed in the main window when the cursor is over the toolbar. This means that if it moved there even moderately quickly, the most recent x &amp;amp; y positions are frozen,placing the cursorinside the graphical area as far as WM_SETCURSOR is concerned, even though it is really outside.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Any suggestions?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;With many thanks&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Mike&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jul 2004 13:12:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790070#M32145</guid>
      <dc:creator>michael_green</dc:creator>
      <dc:date>2004-07-23T13:12:31Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790071#M32146</link>
      <description>&lt;DIV&gt;...but you should test WM_SETCURSOR rather than WM_MOUSEMOVE. Although they're brethren, the difference is that WM_MOUSEMOVE doesn't do a "ping-pong" from children to parent. In other words, when WM_MOUSEMOVE arrives in the toolbar, WM_SETCURSOR will follow it immediately, but WM_SETCURSOR will be then sent to the parent, while WM_MOUSEMOVE will not. &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Where do your "xpos" and "ypos" come from? GetCursorPos? &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jul 2004 14:45:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790071#M32146</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-07-23T14:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790072#M32147</link>
      <description>&lt;DIV&gt;Thankyou Jugoslav, problem solved.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I was getting xpos &amp;amp; ypos thus:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;case (WM_MOUSEMOVE)&lt;/DIV&gt;
&lt;DIV&gt; xpos = LOWORD(lParam); ypos = HIWORD(lParam)&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;but by using GetCursorPos in case (WM_SETCURSOR) there's no problem.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Many thanks again.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;regards&lt;/DIV&gt;
&lt;DIV&gt;Mike&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jul 2004 15:04:12 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790072#M32147</guid>
      <dc:creator>michael_green</dc:creator>
      <dc:date>2004-07-23T15:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: mouse cursor control</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790073#M32148</link>
      <description>&lt;DIV&gt;...converted to client-coordinates via MapWindowPoints or ScreenToClient, I assume?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Glad to hear the problem is solved... &lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Jugoslav&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;(6 working hours to vacation :-) )&lt;/DIV&gt;</description>
      <pubDate>Fri, 23 Jul 2004 15:24:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/mouse-cursor-control/m-p/790073#M32148</guid>
      <dc:creator>Jugoslav_Dujic</dc:creator>
      <dc:date>2004-07-23T15:24:28Z</dc:date>
    </item>
  </channel>
</rss>

