Zhorn Software
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
Posts : 26
Join date : 2020-01-16

Stickies API : Three enhancements would be very useful... Empty Stickies API : Three enhancements would be very useful...

Tue Nov 24, 2020 5:48 pm
Hi Tom,

maybe you already saw in the "Support" branch of the forum that I did some test with ApiCmd.exe.... that eventually failed.

What is the problem : I'd like to use Stickies as an "Alert system" in case some scripts I've launched in the background thanks to Task Manager have any "unsuccessful result".
These tasks are launched to be run with my login account (same account that runs also Stickies)

This works efficiently... provided the tasks are created with the option "Run only when user is logged on"
While in my case I want to be able to launch them with the option "Run wether user is logged on or not"
The problem  is that with this option, APICmd.exe DO NOT DO ANYTHING, and nevertheless return a 0 error code...

I can easily understand that if the sesion of my account is not opened when APICmd.exe runs, it cannot succeed (since in such case, it means that Stickies app is not running)
But in such a case, it should "at least" return a "non zero" rc.

On the other hand, if the session of my account is in fact open, and then stickies IS running, why such a behaviour ???

FYI I did a quick test : whatever the fact that my account session is open or not, for the running task, "Current User" is actually the right account (HKCU is targetting HKUser/myaccount...)

So, now, my enhancements requests :

1) (the most important) To have APIcmd.exe workink efficiently, even if launched by a task that "Run wether user is logged on or not", in the case when the corresponing user is actually logged on, and Stickies program IS running

2) To have APIcmd returning a "non zero" Rc when it didn't succeed (whatever the reason)

3) As mentioned in your WebSite, APIcmd do not return full answer like other API interfaces, since " It's one-way, as command line apps have no window to which Stickies can send replies".
It would be nevertheless easy to have it "full duplex" : Each call of APICmd.exe could write its result in some predefined (or given in parameter) text file.
This could allow calling script, reading this text file, after a "do new sticky" to get the sticky Id of the new created sticky, and then to be able to apply color, size, skin, alarm, etc... thanks to "set desktop <id> ...." commands.

Thanks in advance for what you'll be able to implement of these enhancements.
Posts : 277
Join date : 2018-03-30
Location : London

Stickies API : Three enhancements would be very useful... Empty Re: Stickies API : Three enhancements would be very useful...

Sun Dec 13, 2020 4:17 pm
I've just updated the apicmd.exe file so that it works better.  It now returns three errorlevel values to give you more information on how the command has worked.

However ... in adding them, I discovered that Stickies has never responded correctly to the WM_COPYDATA message.  It should pass back TRUE when the message has been received, but it's always instead passed the message along to Windows, which generates a FALSE.

I'll fix this for Stickies v10.1, but for now you have to read errorlevel 1 as "OK" as well due to a limitation in Stickies.  That's been like that ever since the API was added - and this is the first time I've become aware it's wrong.

As per the other thread, I hope that you've been able to use TCP/IP to achieve what you're aiming for better anyway.

Back to top
Permissions in this forum:
You can reply to topics in this forum