Announcement

Collapse
No announcement yet.

Notification Icon

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Notification Icon

    There are a few dll's kicking about and a plugin that deal with the tray icon but none give a callback for tray icon click/right click and balloon message click or let you set an animated icon or custom balloon icon and these are standard windows features so I figured that this can be done relatively easily with MemoryEx and a hidden window (so not to interfere with other subclasses) to get the callbacks, I'm at this so far:

    Notification Icon.lua.txt

    but the Windows reports the Shell_NotifyIcon as having succeeded but what happens is the taskbar notification area makes way for the new icon but fails to show it and the space created by the call vanishes on mouse over, anyone know whats up?

    Refs:

    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx
    http://msdn.microsoft.com/en-us/libr...=vs.85%29.aspx

  • #2
    in your script, function "CreateTrayIcon"

    if tonumber(Shell32Library.Shell_NotifyIcon(NIM_ADD,p oi)) == 0 then
    TTIi.DestroyIcon(Ih)
    return false, "Create tray icon failed"
    else
    TTIi.DestroyIcon(Ih)
    return true, "OK"
    end
    your destroying the icon in both success and failure???
    Embrace change in your life, you never know, it could all work out for the best

    Comment


    • #3
      Just tested the code with the second destroy removed it opens up a place in the tool bar but no tooltip or icon show.


      --Edit
      Also after running the test more then a few times (pressing the button) it starts to fail.
      Plugins or Sources MokoX
      BunnyHop 2021 Here

      Comment


      • #4
        I was, I read its OK to destroy the resource once its been used but filtering out both destroys still gives the same issue, here is another go with a HWND_MESSAGE window so it wont interfere with the main app window:

        Notification Icon.lua.txt

        I was really looking forward to clicking a balloon and opening a webpage :lol

        Comment


        • #5
          ---------------------------
          Create tray icon failed
          ---------------------------
          OK
          ---------------------------

          This happens all the time now, it does not even show a blank space like it did before.
          Plugins or Sources MokoX
          BunnyHop 2021 Here

          Comment


          • #6
            You have to (on win 7/8) click the ^ arrow then hover over the invisible icons to clear them then it will do it again, the icon can be painted on the page when loaded and set as a title bar icon so I know it loads the icon.........

            Comment


            • #7
              I might be wrong but should this

              Code:
              NOTIFYICONDATA = MemoryEx.DefineStruct{
              	DWORD "cbSize",
              	HWND  "hWnd";
              	UINT  "uID";
              	UINT  "uFlags";
              	UINT  "uCallbackMessage";
              	HICON "hIcon";
              	TCHAR ("szTip",128,1,MEMEX_ASCII);
              	DWORD "dwState";
              	DWORD "dwStateMask";
              	TCHAR ("szInfo",256,1,MEMEX_ASCII);
              	UNION {
              		UINT "uTimeout";
              		UINT "uVersion";
              	};
              	TCHAR ("szInfoTitle",256,1,MEMEX_ASCII);
              	DWORD "dwInfoFlags";
              	GUID  "guidItem";
              	HICON "hBalloonIcon";
              };
              be

              Code:
              NOTIFYICONDATA = MemoryEx.DefineStruct({
              	DWORD "cbSize",
              	HWND  "hWnd",
              	UINT  "uID",
              	UINT  "uFlags",
              	UINT  "uCallbackMessage",
              	HICON "hIcon",
              	TCHAR ("szTip",128,1,MEMEX_ASCII),
              	DWORD "dwState",
              	DWORD "dwStateMask",
              	TCHAR ("szInfo",256,1,MEMEX_ASCII),
              	UNION = {
              		UINT "uTimeout",
              		UINT "uVersion"
              	},
              	TCHAR ("szInfoTitle",256,1,MEMEX_ASCII),
              	DWORD "dwInfoFlags",
              	GUID  "guidItem",
              	HICON "hBalloonIcon"
              })
              Plugins or Sources MokoX
              BunnyHop 2021 Here

              Comment


              • #8
                Shrek, this code makes zero sense to me, i have not used MemoryEx at all but your structures system seems a bit "over complicated" to me

                on line 109 you assign a structure, set some values and close the structure on line 128, wheres the pointer being saved to???

                on line 187 your sending your "GetStrucPointer" function an empty structure definition (NOTIFYICONDATA)

                so what your sending to "Shell_NotifyIcon" is not the structure defined on line 109

                should you not be sending the structure defined on line 109 to "Shell_NotifyIcon" ???
                Embrace change in your life, you never know, it could all work out for the best

                Comment


                • #9
                  I am also lost with the code but I did try making it more readable for myself

                  note.lua.txt

                  I have seen you did included things like the memory free function in places where you can just included it once.

                  I really want to help with this one but I guess IP will be your man with the plugin side, but I would say slowly go throw your code and do the basic things first.
                  Plugins or Sources MokoX
                  BunnyHop 2021 Here

                  Comment


                  • #10
                    also, your creating an edit window with a parent handle of -3 (HWND_MESSAGE), you need a popup child window to assign a tray icon to and you should make all windows children of the main AMS window, an EDIT is a control window, you can nhot assign a sys tray icon to it
                    Embrace change in your life, you never know, it could all work out for the best

                    Comment


                    • #11
                      @Rizla, thanks its working now, one has to close the structure after the icon is set.........

                      Comment


                      • #12
                        Originally posted by Shrek View Post
                        @Rizla, thanks its working now, one has to close the structure after the icon is set.........
                        So what's the fix? I am interested to see it working now I got lost in its code lol
                        Plugins or Sources MokoX
                        BunnyHop 2021 Here

                        Comment


                        • #13
                          Its here:

                          Notification Icon.lua.txt

                          tided it up a bit but it works no problem, just need to subclass a window now to get the callbacks but I was wanting to leave the main one alone.

                          Comment


                          • #14
                            Originally posted by Shrek View Post
                            Its here:

                            [ATTACH]12426[/ATTACH]

                            tided it up a bit but it works no problem, just need to subclass a window now to get the callbacks but I was wanting to leave the main one alone.
                            Thanks for sharing I give this a play with tomorrow, baby needs a change then time for bed my back has gone, sorry I was no help lol
                            Plugins or Sources MokoX
                            BunnyHop 2021 Here

                            Comment


                            • #15
                              Yes, i also got your script working, but i had to make a few changes! lol :yes
                              Embrace change in your life, you never know, it could all work out for the best

                              Comment

                              Working...
                              X