<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Changing the System Cursor</title>
	<atom:link href="http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/</link>
	<description>Daily posts of Excel tips…and other stuff</description>
	<lastBuildDate>Thu, 09 Feb 2012 23:42:03 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Jonas</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-39169</link>
		<dc:creator>Jonas</dc:creator>
		<pubDate>Tue, 28 Apr 2009 14:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-39169</guid>
		<description>&lt;p&gt;Example for a Textbox in a Userform&lt;/p&gt;
&lt;p&gt;This example vill force the cursor to be a hand when you rihgtclick on the Textbox. The cursor vill not change even if any other code will run while rightclick witch normay would set the cursor to a houerglass.&lt;/p&gt;
&lt;p&gt;****************************************&lt;/p&gt;
&lt;p&gt;Private Declare Function LoadCursorFromFile Lib &quot;user32? Alias &quot;LoadCursorFromFileA&quot; (ByVal lpFileName As String) As Long&lt;br&gt;
Private Declare Function CopyIcon Lib &quot;user32? (ByVal hIcon As Long) As Long&lt;br&gt;
Private Declare Function SetSystemCursor Lib &quot;user32? (ByVal hcur As Long, ByVal id As Long) As Long&lt;br&gt;
Private Declare Function GetCursor Lib &quot;user32? () As Long&lt;/p&gt;
&lt;p&gt;Private mbWhatActive As Boolean&lt;br&gt;
Private mlCurrCursor As Long&lt;br&gt;
Private mlDefCursor As Long&lt;br&gt;
Private Const lOCR_NORMAL As Long = 32512&lt;/p&gt;
&lt;p&gt;Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)&lt;br&gt;
    If Button = 2 Then&lt;br&gt;
        Custor_locked True&lt;br&gt;
        &#039;Any code&lt;br&gt;
    End If&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)&lt;br&gt;
    If Button = 2 Then&lt;br&gt;
    Custor_locked False&lt;br&gt;
    End If&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Private Sub Custor_locked(Locked As Boolean)&lt;br&gt;
Dim lCursor As Long&lt;br&gt;
If Locked And mlDefCursor = 0 Then&lt;br&gt;
    Application.Cursor = xlNorthwestArrow&lt;br&gt;
    mlCurrCursor = GetCursor()&lt;br&gt;
    mlDefCursor = CopyIcon(mlCurrCursor)&lt;br&gt;
    lCursor = LoadCursorFromFile(&quot;C:Windowscursorshns.cur&quot;)&lt;br&gt;
    SetSystemCursor lCursor, lOCR_NORMAL&lt;br&gt;
ElseIf Not Locked And Not mlDefCursor = 0 Then&lt;br&gt;
    Application.Cursor = xlDefault&lt;br&gt;
    lCursor = mlDefCursor&lt;br&gt;
    mlDefCursor = 0&lt;br&gt;
    SetSystemCursor lCursor, lOCR_NORMAL&lt;br&gt;
End If&lt;br&gt;
End Sub&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Example for a Textbox in a Userform</p>
<p>This example vill force the cursor to be a hand when you rihgtclick on the Textbox. The cursor vill not change even if any other code will run while rightclick witch normay would set the cursor to a houerglass.</p>
<p>****************************************</p>
<p>Private Declare Function LoadCursorFromFile Lib &#8220;user32? Alias &#8220;LoadCursorFromFileA&#8221; (ByVal lpFileName As String) As Long<br />
Private Declare Function CopyIcon Lib &#8220;user32? (ByVal hIcon As Long) As Long<br />
Private Declare Function SetSystemCursor Lib &#8220;user32? (ByVal hcur As Long, ByVal id As Long) As Long<br />
Private Declare Function GetCursor Lib &#8220;user32? () As Long</p>
<p>Private mbWhatActive As Boolean<br />
Private mlCurrCursor As Long<br />
Private mlDefCursor As Long<br />
Private Const lOCR_NORMAL As Long = 32512</p>
<p>Private Sub TextBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)<br />
    If Button = 2 Then<br />
        Custor_locked True<br />
        &#8216;Any code<br />
    End If<br />
End Sub</p>
<p>Private Sub TextBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)<br />
    If Button = 2 Then<br />
    Custor_locked False<br />
    End If<br />
End Sub</p>
<p>Private Sub Custor_locked(Locked As Boolean)<br />
Dim lCursor As Long<br />
If Locked And mlDefCursor = 0 Then<br />
    Application.Cursor = xlNorthwestArrow<br />
    mlCurrCursor = GetCursor()<br />
    mlDefCursor = CopyIcon(mlCurrCursor)<br />
    lCursor = LoadCursorFromFile(&#8220;C:Windowscursorshns.cur&#8221;)<br />
    SetSystemCursor lCursor, lOCR_NORMAL<br />
ElseIf Not Locked And Not mlDefCursor = 0 Then<br />
    Application.Cursor = xlDefault<br />
    lCursor = mlDefCursor<br />
    mlDefCursor = 0<br />
    SetSystemCursor lCursor, lOCR_NORMAL<br />
End If<br />
End Sub</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Geoff</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-31844</link>
		<dc:creator>Geoff</dc:creator>
		<pubDate>Sun, 13 Apr 2008 18:56:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-31844</guid>
		<description>&lt;p&gt;Apologies if I am incorrect to post here.&lt;/p&gt;
&lt;p&gt;I am seeking to replace the &#039;busy&#039; hourglass icon on the worksheet and thought by modifying the suggestions above it might do the trick. Not. In DeployCursor there are 2 options for testing. One, a msgbox, meant to represent some work. This shows the icon correctly until the msgbox is acknowledged and the cursor reverts.  The other is real work but then the icon replace does NOT work.  Clearly there is some other stuff going on here - but what?&lt;/p&gt;
&lt;p&gt;All code goes into a standard module:&lt;/p&gt;
&lt;div style=&quot;overflow: auto; white-space: nowrap;&quot; class=&quot;codecolorer-container vb default&quot;&gt;&lt;div style=&quot;white-space: nowrap;&quot; class=&quot;vb codecolorer&quot;&gt;&lt;span class=&quot;kw1&quot;&gt;Option&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Explicit&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; CopyIcon &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;(&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; hIcon &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; LoadCursorFromFile &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Alias&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;LoadCursorFromFileA&quot;&lt;/span&gt; _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;(&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; lpFileName &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; SetCursor &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; (&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; hCursor &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; SetSystemCursor &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; _&lt;br&gt;
&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; (&lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; hcur &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, &lt;span class=&quot;kw1&quot;&gt;ByVal&lt;/span&gt; id &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;) &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Declare&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Function&lt;/span&gt; GetCursor &lt;span class=&quot;kw1&quot;&gt;Lib&lt;/span&gt; &lt;span class=&quot;st0&quot;&gt;&quot;user32&quot;&lt;/span&gt; () &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Public&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Const&lt;/span&gt; lOCR_NORMAL &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt; = 32512&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; mbWhatActive &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Boolean&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; mlCurrCursor &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; mlDefCursor &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; sCursPath &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; ToggleCursor()&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; mbWhatActive &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; ChangeCursor &lt;span class=&quot;st0&quot;&gt;&quot;C:Windowscursorsarrow_m.cur&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; mbWhatActive = &lt;span class=&quot;kw1&quot;&gt;False&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; ChangeCursor Application.Path &amp; &lt;span class=&quot;st0&quot;&gt;&quot;MSN.ico&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; mbWhatActive = &lt;span class=&quot;kw1&quot;&gt;True&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Private&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; ChangeCursor(&lt;span class=&quot;kw1&quot;&gt;Optional&lt;/span&gt; sCursPath &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;String&lt;/span&gt;)&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; lCursor &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt; sCursPath = Application.Path &amp; &lt;span class=&quot;st0&quot;&gt;&quot;MSN.ico&quot;&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Then&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; &#160; &#160; mlCurrCursor = GetCursor()&lt;br&gt;
&#160; &#160; &#160; &#160; mlDefCursor = CopyIcon(mlCurrCursor)&lt;br&gt;
&#160; &#160; &#160; &#160; lCursor = LoadCursorFromFile(sCursPath)&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Else&lt;/span&gt;&lt;br&gt;
&#160; &#160; &#160; &#160; mlCurrCursor = GetCursor()&lt;br&gt;
&#160; &#160; &#160; &#160; mlDefCursor = CopyIcon(mlCurrCursor)&lt;br&gt;
&#160; &#160; &#160; &#160; lCursor = LoadCursorFromFile(sCursPath)&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;If&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; SetSystemCursor lCursor, lOCR_NORMAL&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt; DeployCursor()&lt;br&gt;
&lt;br&gt;
&#160; &#160; &lt;span class=&quot;kw1&quot;&gt;Dim&lt;/span&gt; x &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;, y &lt;span class=&quot;kw1&quot;&gt;As&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Long&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&#160; &#160; ToggleCursor&lt;br&gt;
&lt;br&gt;
&#160; &#160; MsgBox &lt;span class=&quot;st0&quot;&gt;&quot;&quot;&lt;/span&gt;&lt;br&gt;
&#160; &#160; &lt;br&gt;
&#160; &#160; &lt;span class=&quot;co1&quot;&gt;&#039;&#039; &#160; &#160;For x = 1 To 1000&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;co1&quot;&gt;&#039;&#039; &#160; &#160; &#160; &#160;For y = 1 To 10000&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;co1&quot;&gt;&#039;&#039; &#160; &#160; &#160; &#160;Next y&lt;br&gt;
&lt;/span&gt; &#160; &#160;&lt;span class=&quot;co1&quot;&gt;&#039;&#039; &#160; &#160;Next x&lt;br&gt;
&lt;/span&gt;&lt;br&gt;
&#160; &#160; ToggleCursor&lt;br&gt;
&lt;br&gt;
&lt;span class=&quot;kw1&quot;&gt;End&lt;/span&gt; &lt;span class=&quot;kw1&quot;&gt;Sub&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;
</description>
		<content:encoded><![CDATA[<p>Apologies if I am incorrect to post here.</p>
<p>I am seeking to replace the &#8216;busy&#8217; hourglass icon on the worksheet and thought by modifying the suggestions above it might do the trick. Not. In DeployCursor there are 2 options for testing. One, a msgbox, meant to represent some work. This shows the icon correctly until the msgbox is acknowledged and the cursor reverts.  The other is real work but then the icon replace does NOT work.  Clearly there is some other stuff going on here &#8211; but what?</p>
<p>All code goes into a standard module:</p>
<div style="overflow: auto; white-space: nowrap;" class="codecolorer-container vb default">
<div style="white-space: nowrap;" class="vb codecolorer"><span class="kw1">Option</span> <span class="kw1">Explicit</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> CopyIcon <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(<span class="kw1">ByVal</span> hIcon <span class="kw1">As</span> <span class="kw1">Long</span>) <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> LoadCursorFromFile <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> <span class="kw1">Alias</span> <span class="st0">&#8220;LoadCursorFromFileA&#8221;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;(<span class="kw1">ByVal</span> lpFileName <span class="kw1">As</span> <span class="kw1">String</span>) <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> SetCursor <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (<span class="kw1">ByVal</span> hCursor <span class="kw1">As</span> <span class="kw1">Long</span>) <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> SetSystemCursor <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> _<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (<span class="kw1">ByVal</span> hcur <span class="kw1">As</span> <span class="kw1">Long</span>, <span class="kw1">ByVal</span> id <span class="kw1">As</span> <span class="kw1">Long</span>) <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Declare</span> <span class="kw1">Function</span> GetCursor <span class="kw1">Lib</span> <span class="st0">&#8220;user32&#8243;</span> () <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p><span class="kw1">Public</span> <span class="kw1">Const</span> lOCR_NORMAL <span class="kw1">As</span> <span class="kw1">Long</span> = 32512</p>
<p>
<span class="kw1">Private</span> mbWhatActive <span class="kw1">As</span> <span class="kw1">Boolean</span><br />
<span class="kw1">Private</span> mlCurrCursor <span class="kw1">As</span> <span class="kw1">Long</span><br />
<span class="kw1">Private</span> mlDefCursor <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p><span class="kw1">Dim</span> sCursPath <span class="kw1">As</span> <span class="kw1">String</span></p>
<p><span class="kw1">Private</span> <span class="kw1">Sub</span> ToggleCursor()</p>
<p>&nbsp; &nbsp; <span class="kw1">If</span> mbWhatActive <span class="kw1">Then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ChangeCursor <span class="st0">&#8220;C:Windowscursorsarrow_m.cur&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; mbWhatActive = <span class="kw1">False</span><br />
&nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ChangeCursor Application.Path &amp;amp; <span class="st0">&#8220;MSN.ico&#8221;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; mbWhatActive = <span class="kw1">True</span><br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span></p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Private</span> <span class="kw1">Sub</span> ChangeCursor(<span class="kw1">Optional</span> sCursPath <span class="kw1">As</span> <span class="kw1">String</span>)</p>
<p>&nbsp; &nbsp; <span class="kw1">Dim</span> lCursor <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p>&nbsp; &nbsp; <span class="kw1">If</span> sCursPath = Application.Path &amp;amp; <span class="st0">&#8220;MSN.ico&#8221;</span> <span class="kw1">Then</span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; mlCurrCursor = GetCursor()<br />
&nbsp; &nbsp; &nbsp; &nbsp; mlDefCursor = CopyIcon(mlCurrCursor)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lCursor = LoadCursorFromFile(sCursPath)</p>
<p>&nbsp; &nbsp; <span class="kw1">Else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; mlCurrCursor = GetCursor()<br />
&nbsp; &nbsp; &nbsp; &nbsp; mlDefCursor = CopyIcon(mlCurrCursor)<br />
&nbsp; &nbsp; &nbsp; &nbsp; lCursor = LoadCursorFromFile(sCursPath)<br />
&nbsp; &nbsp; <span class="kw1">End</span> <span class="kw1">If</span></p>
<p>&nbsp; &nbsp; SetSystemCursor lCursor, lOCR_NORMAL</p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></p>
<p><span class="kw1">Sub</span> DeployCursor()</p>
<p>&nbsp; &nbsp; <span class="kw1">Dim</span> x <span class="kw1">As</span> <span class="kw1">Long</span>, y <span class="kw1">As</span> <span class="kw1">Long</span></p>
<p>&nbsp; &nbsp; ToggleCursor</p>
<p>&nbsp; &nbsp; MsgBox <span class="st0">&#8220;&#8221;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span class="co1">&#8221; &nbsp; &nbsp;For x = 1 To 1000<br />
</span> &nbsp; &nbsp;<span class="co1">&#8221; &nbsp; &nbsp; &nbsp; &nbsp;For y = 1 To 10000<br />
</span> &nbsp; &nbsp;<span class="co1">&#8221; &nbsp; &nbsp; &nbsp; &nbsp;Next y<br />
</span> &nbsp; &nbsp;<span class="co1">&#8221; &nbsp; &nbsp;Next x<br />
</span><br />
&nbsp; &nbsp; ToggleCursor</p>
<p><span class="kw1">End</span> <span class="kw1">Sub</span></div>
</div>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Schoeninger</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-9938</link>
		<dc:creator>Lars Schoeninger</dc:creator>
		<pubDate>Thu, 31 Mar 2005 14:14:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-9938</guid>
		<description>&lt;p&gt;True if fully developed. Thanks anyway&lt;/p&gt;
&lt;p&gt;Lars&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>True if fully developed. Thanks anyway</p>
<p>Lars</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-9937</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Thu, 31 Mar 2005 13:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-9937</guid>
		<description>&lt;p&gt;Lars:  The problem with that is if the user has changed their default cursor, then you&#039;d be changing it back to your default cursor.  Once fully developed, the user wouldn&#039;t be able to close the userform because all the close mechanism would have help associated with them.  However, a call to ChangeCursor (with no arguments) from the QueryClose event does the trick too.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Lars:  The problem with that is if the user has changed their default cursor, then you&#8217;d be changing it back to your default cursor.  Once fully developed, the user wouldn&#8217;t be able to close the userform because all the close mechanism would have help associated with them.  However, a call to ChangeCursor (with no arguments) from the QueryClose event does the trick too.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dick Kusleika</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-9936</link>
		<dc:creator>Dick Kusleika</dc:creator>
		<pubDate>Thu, 31 Mar 2005 13:11:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-9936</guid>
		<description>&lt;p&gt;Also this may help.&lt;br&gt;
&lt;a href=&quot;http://www.andypope.info/vba/whatsthishelp.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.andypope.info/vba/whatsthishelp.htm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;That look like just what I wanted to do.  Thanks, Andy.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Also this may help.<br />
<a href="http://www.andypope.info/vba/whatsthishelp.htm" rel="nofollow">http://www.andypope.info/vba/whatsthishelp.htm</a></p>
<p>That look like just what I wanted to do.  Thanks, Andy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lars Schoenigner</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-9935</link>
		<dc:creator>Lars Schoenigner</dc:creator>
		<pubDate>Thu, 31 Mar 2005 09:48:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-9935</guid>
		<description>&lt;p&gt;Dick,&lt;/p&gt;
&lt;p&gt;its very useful to change the m-icon. However when I close the UserForm when the hlp icon is active and restart restart the form the hlp icon won&#039;t change back to default.&lt;br&gt;
The solution was a little script addition:&lt;/p&gt;
&lt;p&gt;Private Sub cmdWhat_Click()&lt;br&gt;
    If mbWhatActive Then&lt;br&gt;
      ChangeCursor &quot;C:WINNTcursorsarrow_m.cur&quot;&lt;br&gt;
        mbWhatActive = False&lt;br&gt;
    Else&lt;br&gt;
        ChangeCursor &quot;C:WINNTcursorshelp_r.cur&quot;&lt;br&gt;
        mbWhatActive = True&lt;br&gt;
    End If&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Private Sub ChangeCursor(Optional sCursPath As String)&lt;/p&gt;
&lt;p&gt;    Dim lCursor As Long&lt;/p&gt;
&lt;p&gt;    If sCursPath  &quot;C:WINNTcursorshelp_r.cur&quot; Then&lt;/p&gt;
&lt;p&gt;         mlCurrCursor = GetCursor()&lt;br&gt;
         mlDefCursor = CopyIcon(mlCurrCursor)&lt;br&gt;
         lCursor = LoadCursorFromFile(sCursPath)&lt;/p&gt;
&lt;p&gt;    Else&lt;br&gt;
        mlCurrCursor = GetCursor()&lt;br&gt;
        mlDefCursor = CopyIcon(mlCurrCursor)&lt;br&gt;
        lCursor = LoadCursorFromFile(sCursPath)&lt;br&gt;
    End If&lt;/p&gt;
&lt;p&gt;    SetSystemCursor lCursor, lOCR_NORMAL&lt;/p&gt;
&lt;p&gt;End Sub&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;
&lt;p&gt;Lars&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Dick,</p>
<p>its very useful to change the m-icon. However when I close the UserForm when the hlp icon is active and restart restart the form the hlp icon won&#8217;t change back to default.<br />
The solution was a little script addition:</p>
<p>Private Sub cmdWhat_Click()<br />
    If mbWhatActive Then<br />
      ChangeCursor &#8220;C:WINNTcursorsarrow_m.cur&#8221;<br />
        mbWhatActive = False<br />
    Else<br />
        ChangeCursor &#8220;C:WINNTcursorshelp_r.cur&#8221;<br />
        mbWhatActive = True<br />
    End If</p>
<p>End Sub</p>
<p>Private Sub ChangeCursor(Optional sCursPath As String)</p>
<p>    Dim lCursor As Long</p>
<p>    If sCursPath  &#8220;C:WINNTcursorshelp_r.cur&#8221; Then</p>
<p>         mlCurrCursor = GetCursor()<br />
         mlDefCursor = CopyIcon(mlCurrCursor)<br />
         lCursor = LoadCursorFromFile(sCursPath)</p>
<p>    Else<br />
        mlCurrCursor = GetCursor()<br />
        mlDefCursor = CopyIcon(mlCurrCursor)<br />
        lCursor = LoadCursorFromFile(sCursPath)<br />
    End If</p>
<p>    SetSystemCursor lCursor, lOCR_NORMAL</p>
<p>End Sub</p>
<p>Cheers</p>
<p>Lars</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Pope</title>
		<link>http://www.dailydoseofexcel.com/archives/2005/03/30/changing-the-system-cursor/#comment-9934</link>
		<dc:creator>Andy Pope</dc:creator>
		<pubDate>Thu, 31 Mar 2005 09:13:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dailydoseofexcel.com/?p=1073#comment-9934</guid>
		<description>&lt;p&gt;Hi Dick,&lt;/p&gt;
&lt;p&gt;No need to resort to the API for the arrow+question mark cursor.&lt;br&gt;
Try the following code in a userform with a button.&lt;/p&gt;
&lt;p&gt;Private Sub CommandButton1_Click()&lt;br&gt;
&#039; arrow + questionmark&lt;br&gt;
    Me.MousePointer = fmMousePointerHelp&lt;br&gt;
End Sub&lt;br&gt;
Private Sub UserForm_Click()&lt;br&gt;
    Me.MousePointer = fmMousePointerDefault&lt;br&gt;
End Sub&lt;/p&gt;
&lt;p&gt;Also this may help.&lt;br&gt;
&lt;a href=&quot;http://www.andypope.info/vba/whatsthishelp.htm&quot; rel=&quot;nofollow&quot;&gt;http://www.andypope.info/vba/whatsthishelp.htm&lt;/a&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hi Dick,</p>
<p>No need to resort to the API for the arrow+question mark cursor.<br />
Try the following code in a userform with a button.</p>
<p>Private Sub CommandButton1_Click()<br />
&#8216; arrow + questionmark<br />
    Me.MousePointer = fmMousePointerHelp<br />
End Sub<br />
Private Sub UserForm_Click()<br />
    Me.MousePointer = fmMousePointerDefault<br />
End Sub</p>
<p>Also this may help.<br />
<a href="http://www.andypope.info/vba/whatsthishelp.htm" rel="nofollow">http://www.andypope.info/vba/whatsthishelp.htm</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>

