Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default set cursor with api

Need to set the cursor in Excel with the API, so tried this:

Option Explicit
Private Const IDC_ARROW As Long = 32512
Private Declare Function LoadCursor _
Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait 'just to test it alters the cursor

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

However nil happens, although there is no error.
Any suggestions how this could be done?


RBS


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default set cursor with api

Isn't that just the type definition for a long variable?
In any case I did it like that at one stage and just the same.
I think the trouble is that Excel or VB in general will keep setting the
cursor
back to the original.

RBS


"Gary L Brown" wrote in message
...
I found a google at...
http://groups.google.com/group/micro...6102c2ae 7954

that seems to indicate that you should change
Private Const IDC_ARROW As Long = 32512
to
Private Const IDC_ARROW As Long = 32512&

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was
this
Post Helpfull to you?''.


"RB Smissaert" wrote:

Need to set the cursor in Excel with the API, so tried this:

Option Explicit
Private Const IDC_ARROW As Long = 32512
Private Declare Function LoadCursor _
Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait 'just to test it alters the cursor

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

However nil happens, although there is no error.
Any suggestions how this could be done?


RBS




  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default set cursor with api

Have you tried this?

Option Explicit
Private Const IDC_ARROW = 32512&
Private Declare Function LoadCursor _
Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

As you can see (with me anyhow), the cursor stays hourglass.


RBS

"Gary L Brown" wrote in message
...
All I can say is that the guy in the thread below (Paul Martin) implied
that
it worked. His code is virtually identical to yours.
Good Luck,
Sincerely,
--
Gary Brown



"RB Smissaert" wrote:

Isn't that just the type definition for a long variable?
In any case I did it like that at one stage and just the same.
I think the trouble is that Excel or VB in general will keep setting the
cursor
back to the original.

RBS


"Gary L Brown" wrote in message
...
I found a google at...
http://groups.google.com/group/micro...6102c2ae 7954

that seems to indicate that you should change
Private Const IDC_ARROW As Long = 32512
to
Private Const IDC_ARROW As Long = 32512&

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was
this
Post Helpfull to you?''.


"RB Smissaert" wrote:

Need to set the cursor in Excel with the API, so tried this:

Option Explicit
Private Const IDC_ARROW As Long = 32512
Private Declare Function LoadCursor _
Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait 'just to test it alters the cursor

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

However nil happens, although there is no error.
Any suggestions how this could be done?


RBS








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 219
Default set cursor with api

No. Haven't tried it.
After looking at the google again, I did notice another difference in code.

Try...
SetCursor LoadCursor(0, lCursor)
instead of
SetCursor (LoadCursor(0, IDC_ARROW))

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was this
Post Helpfull to you?''.


"RB Smissaert" wrote:

Have you tried this?

Option Explicit
Private Const IDC_ARROW = 32512&
Private Declare Function LoadCursor _
Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

As you can see (with me anyhow), the cursor stays hourglass.


RBS

"Gary L Brown" wrote in message
...
All I can say is that the guy in the thread below (Paul Martin) implied
that
it worked. His code is virtually identical to yours.
Good Luck,
Sincerely,
--
Gary Brown



"RB Smissaert" wrote:

Isn't that just the type definition for a long variable?
In any case I did it like that at one stage and just the same.
I think the trouble is that Excel or VB in general will keep setting the
cursor
back to the original.

RBS


"Gary L Brown" wrote in message
...
I found a google at...
http://groups.google.com/group/micro...6102c2ae 7954

that seems to indicate that you should change
Private Const IDC_ARROW As Long = 32512
to
Private Const IDC_ARROW As Long = 32512&

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was
this
Post Helpfull to you?''.


"RB Smissaert" wrote:

Need to set the cursor in Excel with the API, so tried this:

Option Explicit
Private Const IDC_ARROW As Long = 32512
Private Declare Function LoadCursor _
Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait 'just to test it alters the cursor

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

However nil happens, although there is no error.
Any suggestions how this could be done?


RBS







  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default set cursor with api

Before suggesting things to try it might be worth it to try first and see if
it is any good ...

RBS


"Gary L Brown" wrote in message
...
No. Haven't tried it.
After looking at the google again, I did notice another difference in
code.

Try...
SetCursor LoadCursor(0, lCursor)
instead of
SetCursor (LoadCursor(0, IDC_ARROW))

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to ''Was
this
Post Helpfull to you?''.


"RB Smissaert" wrote:

Have you tried this?

Option Explicit
Private Const IDC_ARROW = 32512&
Private Declare Function LoadCursor _
Lib "user32" Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As Long

Sub test()

Application.Cursor = xlWait

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

As you can see (with me anyhow), the cursor stays hourglass.


RBS

"Gary L Brown" wrote in message
...
All I can say is that the guy in the thread below (Paul Martin) implied
that
it worked. His code is virtually identical to yours.
Good Luck,
Sincerely,
--
Gary Brown



"RB Smissaert" wrote:

Isn't that just the type definition for a long variable?
In any case I did it like that at one stage and just the same.
I think the trouble is that Excel or VB in general will keep setting
the
cursor
back to the original.

RBS


"Gary L Brown" wrote in message
...
I found a google at...
http://groups.google.com/group/micro...6102c2ae 7954

that seems to indicate that you should change
Private Const IDC_ARROW As Long = 32512
to
Private Const IDC_ARROW As Long = 32512&

HTH,
--
Gary Brown

If this post was helpful, please click the ''Yes'' button next to
''Was
this
Post Helpfull to you?''.


"RB Smissaert" wrote:

Need to set the cursor in Excel with the API, so tried this:

Option Explicit
Private Const IDC_ARROW As Long = 32512
Private Declare Function LoadCursor _
Lib "user32" _
Alias "LoadCursorA" _
(ByVal hInstance As Long, _
ByVal lpCursorName As Long) As Long
Private Declare Function SetCursor _
Lib "user32" (ByVal hCursor As Long) As
Long

Sub test()

Application.Cursor = xlWait 'just to test it alters the cursor

SetCursor (LoadCursor(0, IDC_ARROW))

End Sub

However nil happens, although there is no error.
Any suggestions how this could be done?


RBS








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
My cursor always in selection mode,wat about other cursor option Deepu[_2_] Excel Discussion (Misc queries) 1 March 2nd 10 01:05 AM
move cursor on one sheet moves cursor on all sheets tdworden Excel Discussion (Misc queries) 2 July 22nd 07 10:50 PM
why am I getting a 3 d cross cursor instead of a pointer cursor? 3 d cross cursor - turn it off Excel Discussion (Misc queries) 1 April 12th 06 12:38 AM
Cursor disappears / Cursor verschwindet Cevikel Excel Programming 1 February 16th 06 04:01 PM
Can I change the "white cross" cursor in Excel to another cursor? KFEagle Excel Discussion (Misc queries) 1 May 3rd 05 08:01 PM


All times are GMT +1. The time now is 03:55 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"