News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Animated Taskbar and tray icons

Started by Mihail, January 24, 2012, 04:05:03 PM

Previous topic - Next topic

dedndave

almost done...
i have to go over and do a little favour for mom   :P
i'll be back in an hour or so and finish it up

i wonder if we could get a moderator to move this thread to the Campus ?

dedndave

thanks Michael   :U

i have it going - i just need to finish the dialog box stuff and do clean-up
you can play with it....

Mihail

ouuuch , thanks you very muck for this job. its wonderfuul :F

dedndave

my pleasure   :U

here is the finished version

added the dialog group box w/text
cleaned up some code
also cleaned up some of the anomalous pixels in the icons

dedndave

i meant to mention....

the guy that wrote that fasm code had a habit of doing things twice   :red

  .wminitdialog:
invoke LoadIcon,[hInstance],1                         ;1
invoke SendMessage,[hwnddlg],WM_SETICON,ICON_BIG,eax
invoke SetTimer,[hwnddlg],1,100,NULL                  ;1
mov [nIcon],1                                      ;1
mov [node.cbSize],sizeof.NOTIFYICONDATA
mov eax,[hwnddlg]
mov [node.hWnd],eax
mov [node.uID],NULL
mov [node.uFlags],NIF_ICON
mov [node.uCallbackMessage],NULL
invoke LoadIcon, [hInstance], 1                       ;2
mov [node.hIcon],eax
invoke Shell_NotifyIcon, NIM_ADD,node
invoke SetTimer,[hwnddlg],1,100,NULL                  ;2
mov [nIcon],1                                      ;2
jmp .processed



Don57


Mihail


Mihail

Quote from: dedndave on January 26, 2012, 01:27:29 AM
i meant to mention....

the guy that wrote that fasm code had a habit of doing things twice   :red

  .wminitdialog:
invoke LoadIcon,[hInstance],1                         ;1
invoke SendMessage,[hwnddlg],WM_SETICON,ICON_BIG,eax
invoke SetTimer,[hwnddlg],1,100,NULL                  ;1
mov [nIcon],1                                      ;1
mov [node.cbSize],sizeof.NOTIFYICONDATA
mov eax,[hwnddlg]
mov [node.hWnd],eax
mov [node.uID],NULL
mov [node.uFlags],NIF_ICON
mov [node.uCallbackMessage],NULL
invoke LoadIcon, [hInstance], 1                       ;2
mov [node.hIcon],eax
invoke Shell_NotifyIcon, NIM_ADD,node
invoke SetTimer,[hwnddlg],1,100,NULL                  ;2
mov [nIcon],1                                      ;2
jmp .processed



this is done for the tray and taskbar separately)

dedndave

thanks guys   :U

here is the code i replaced it with...
        mov     esi,offset nid
        mov     eax,hIcons
        mov     ebx,hWnd
        xor     edi,edi
        mov     [esi].NOTIFYICONDATA.hIcon,eax
        INVOKE  SendMessage,ebx,WM_SETICON,ICON_BIG,eax
        mov     [esi].NOTIFYICONDATA.cbSize,sizeof NOTIFYICONDATA
        mov     [esi].NOTIFYICONDATA.hwnd,ebx
        mov     [esi].NOTIFYICONDATA.uID,IDT_TIMER0     ;should probably be EDI (0)
        mov     [esi].NOTIFYICONDATA.uFlags,NIF_ICON
        mov     [esi].NOTIFYICONDATA.uCallbackMessage,edi
        INVOKE  Shell_NotifyIcon,NIM_ADD,esi
        INVOKE  SetTimer,ebx,IDT_TIMER0,TIMER_ELAPSE,edi


i load all the icon handles into an array during program initialization

dedndave

in the code above, i had tried putting IDT_TIMER0 into the NOTIFYICONDATA.uID member during debug
it should be 0....