Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Tray icon without DLL (Rudolpho)egui

Author
Message
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 27th Jun 2017 09:27 Edited at: 27th Jun 2017 10:17
Since the original thread has long ago been locked I had to start a new one. I have copied Rudolpho's code to create a system tray icon and that's all working ok. However I can't receive any messages from the icon even though they should be sent to the main dbpro program's window. I use bluegui and I also tried grabbing the message queue with dll calls but nothing. Using spy++ I can see that the tray icon messages are getting to the dbpro program's queue but somehow they are being 'eaten'. In the original thread Rudolpho mentioned it was easy to grab these messages if you use bluegui so I was hoping he could elaborate


Original thread here
https://forum.thegamecreators.com/thread/206217

Cheers
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 28th Jun 2017 03:16 Edited at: 28th Jun 2017 03:36
Have you called the function - NID_SetCallbackMessage. I believe the value set with this function will be returned by the BlueGUI function - eventSource. Then check the event type of the notification icon.

Edit: For the notification callback you should use WM_SHELLNOTIFY: 1029 decimal / 0x0405 hex.
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 28th Jun 2017 09:34
Thanks yes I'm setting the CallBackMessage (and the NIF_MESSAGE flag) but AFAIK that's just an identifier for your own use, I'm using WM_APP+1. When I use Spy++ to examine the tray icon messages, they do have my identifier.

Reading more online examples It looks like it involves subclassing but I could never get the hang of that.
sladeiw
14
Years of Service
User Offline
Joined: 16th May 2009
Location: UK
Posted: 28th Jun 2017 20:13 Edited at: 28th Jun 2017 20:16
Current test code

WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 30th Jun 2017 03:50 Edited at: 30th Jun 2017 03:53
I have been trying to get a working demo. I have written C++ code that works perfectly without any sub-classing. I really think it could work, Some things in DBPro I remember, like strings are passed to dll calls by reference. So, the memory allocations you are using to pass strings, is not needed. Other things, I don't quite remember. Like some of the differences between C++ and DBPro. It's these things that are tripping me up. Will keep trying.

Login to post a reply

Server time is: 2024-02-24 17:07:38
Your offset time is: 2024-02-24 17:07:38