In Python 3, strings are Unicode. Try using a byte string:
>>> import array
>>> array.array('b',b'do new sticky')
array('b', [100, 111, 32, 110, 101, 119, 32, 115, 116, 105, 99, 107, 121])
There are a few other changes as well:
import struct, array
int_buffer = array.array("L", [0])
char_buffer = array.array('b', b'do new sticky')
int_buffer_address = int_buffer.buffer_info()[0]
# Add () to buffer_info to call it.
char_buffer_address, char_buffer_size = char_buffer.buffer_info()
# Need P type for the addresses.
copy_struct = struct.pack("PLP",int_buffer_address,char_buffer_size, char_buffer_address)
I didn't install the software, but I think the next lines should be:
hwnd = win32gui.FindWindow(None, "ZhornSoftwareStickiesMain")
win32gui.SendMessage(hwnd, win32con.WM_COPYDATA, None, copy_struct)
Edit
I installed the software. Initially I couldn't get any commands to work, but the trick that wasn't clear from the API documentation is that each string must start with api
:
import struct
import win32con
import win32gui
import array
char_buffer = array.array('B', b'api do new sticky hello, world')
char_buffer_address, char_buffer_size = char_buffer.buffer_info()
copy_struct = struct.pack("PLP", 12345, char_buffer_size, char_buffer_address)
hwnd = win32gui.FindWindow(None, "ZhornSoftwareStickiesMain")
win32gui.SendMessage(hwnd, win32con.WM_COPYDATA, None, copy_struct)