The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Mihail on January 24, 2012, 04:05:03 PM



Title: Animated Taskbar and tray icons
Post by: Mihail on January 24, 2012, 04:05:03 PM
Hi guys, I'm new to programming. problem in anything, I created a program with the aid of GUI in masm editor and uploaded to the resources of 25 icons, please help, how to animate them in the tray and taskbar. I apologize for my bad English (it's all Google is guilty, he translated)))
I will be very grateful for help=)


Title: Re: Animated Taskbar and tray icons
Post by: ragdog on January 24, 2012, 05:12:40 PM
Search function :U

http://www.masm32.com/board/index.php?topic=17923.msg151183#msg151183


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 24, 2012, 05:22:38 PM
i want animate this icons without  dial inet conection :D , easy  with invoke SetTimer  with 200 ms delay :D


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 24, 2012, 05:24:10 PM
i have this project on Flat asembler, but i can't  convert syntax or disasemble exe >masm  :(


Title: Re: Animated Taskbar and tray icons
Post by: ragdog on January 24, 2012, 06:35:16 PM
Quote:
i have this project on Flat asembler


::) your project.zip  say what other

\MASM32\BIN\Rc.exe /v rsrc.rc
\MASM32\BIN\Cvtres.exe /machine:ix86 rsrc.res

Code:
i want animate this icons without  dial inet conection :D , easy  with invoke SetTimer  with 200 ms delay :D

This is coding  :bg

Look in to source and you can found this part to create the Notify Icon,Load the icons and the Timer part for Blinking icons




Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 24, 2012, 08:15:38 PM
no , this project.zip  im created in masm )) but i have  working programm writed at fasm =)


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 25, 2012, 12:03:31 AM
i can't find animation function with timer at this  post :(


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 25, 2012, 12:20:34 AM
this project in fasm  . . .


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 25, 2012, 02:19:23 AM
so  . . . someone has ideas how to implement it on masm32 ?


Title: Re: Animated Taskbar and tray icons
Post by: Gunner on January 25, 2012, 02:25:36 AM
Uh, the same exact way you did it in FASM.  You have no code in your MASM zip.  Where is SetTimer, Shell_NotifyIcon and the rest of your FASM code?


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 25, 2012, 02:38:45 AM
I do not know how to implement this  in masm  . . .


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 25, 2012, 02:46:42 AM
should be pretty easy  :P
i will have a look at it, tomorrow


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 25, 2012, 08:14:42 AM
i started out by examining the icons
there are 25 icons in the project
however, only 10 are unique   :P
we can use icons 1 through 5 and 16 through 20 - only need 10
of course, we'll have to add a little code to select the right icon at the right time
but it will eliminate ~36 Kb from the resource section

eyes open:
1 = 6 = 11
2 = 7 = 12
3 = 8 = 13
4 = 9 = 14
5 = 10 = 15

eyes closed:
16 = 21
17 = 22 (22 has a flaw)
18 = 23
19 = 24
20 = 25

we could probably reduce it further by creating a single icon file with the 10 icons
we'll worry about that later


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 25, 2012, 12:48:07 PM
size of project does not matter :)


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 25, 2012, 02:08:04 PM
it's ok - it's a matter of efficiency  :bg


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 25, 2012, 05:19:01 PM
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 ?


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 25, 2012, 08:52:48 PM
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....


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 25, 2012, 09:10:37 PM
ouuuch , thanks you very muck for this job. its wonderfuul :F


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 26, 2012, 01:15:22 AM
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


Title: Re: Animated Taskbar and tray icons
Post by: 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

Code:
  .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



Title: Re: Animated Taskbar and tray icons
Post by: Don57 on January 26, 2012, 01:52:29 AM
Very Nice


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 26, 2012, 11:14:28 AM
good job :D very nice )


Title: Re: Animated Taskbar and tray icons
Post by: Mihail on January 26, 2012, 11:20:21 AM
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

Code:
  .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)


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 26, 2012, 01:09:59 PM
thanks guys   :U

here is the code i replaced it with...
Code:
        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


Title: Re: Animated Taskbar and tray icons
Post by: dedndave on January 26, 2012, 02:16:26 PM
in the code above, i had tried putting IDT_TIMER0 into the NOTIFYICONDATA.uID member during debug
it should be 0....


The MASM Forum Archive 2004 to 2012 | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.