Hi list,
I made some progress but I'm still a bit lost here.
I managed to get Pharo to be headless in Win32, by hiding the window via NB as Igor suggested, plus suspending the UI process (UIManager default uiProcess suspend), which was the cause for the window to show up again after a fraction of a second, because of the refresh interval.
However, now I can only close Pharo by killing the process manually, which is not very nice for the end user. So I figured I'd try to add an icon to the system tray with a single context menu entry for closing Pharo.
NBWin32Shell >> shellNotifyIcon: lpdata dwMessage: dwMessage
<primitive: #primitiveNativeCall module: #NativeBoostPlugin>
^ self nbCall: #(bool Shell_NotifyIcon(
�� DWORD dwMessage,
�� PNOTIFYICONDATA lpdata
)) module: #shell32
dwMessage is just a 0 (flag to create a tray icon), but lpdata needs to be a pointer to a struct of this form:typedef struct _NOTIFYICONDATA {
�� UINT ��uCallbackMessage;
�� TCHAR szInfoTitle[64];
} NOTIFYICONDATA, *PNOTIFYICONDATA;
So, my question is: how do I translate this into NB code? How does one define a struct and then pass its pointer to a function in NativeBoost?
Thanks a lot for your help, I'm getting closer :)
Bernat.
p.s. Could the Windows API be any more convoluted and dev-unfriendly in any possible sense?