ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cursor Type (https://www.excelbanter.com/excel-programming/356234-cursor-type.html)

Necessitysslave

Cursor Type
 
Hi,
I'm using Excel macros to interface with a third party piece of
software. mostly this is going well as I've taken to loading api
commands to run most of my interactions.

However, I'm trying to tell whether the system is currently working
(it'll save a lot of useless waiting time) but the only external sign
that the system is working is the mouse changing icon.

the code I've tried:

Private Declare Function CopyIcon Lib "user32" (ByVal hIcon As Long) As
Long
Private Declare Function GetCursor Lib "user32" () As Long

Sub curs()
Dim row As Integer
row = 2
Dim ttime As Long
Dim ttime1 As Long
Dim cursor
ttime = timeGetTime
Do
ttime1 = timeGetTime
Do
DoEvents
Loop Until ttime1 + 50 < timeGetTime
cursor = GetCursor
If Worksheets(1).Range("A" & row - 1) < cursor Then
Worksheets(1).Range("A" & row) = cursor
row = row + 1
End If
Loop Until ttime + 20000 < timeGetTime
End Sub

all this is doing is monitoring the changing Icon this works wonders
until it gets to the third party program this program (SMS if anyone
knows it (its old!)) where it just sticks on the number 65544.

Has Anyone got any ideas that might help?



All times are GMT +1. The time now is 10:46 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com