[comp.windows.ms.programmer] Flashing Icons

rkt@bjcong.bj.co.uk (RAKESH TANDON) (04/25/91)

Hi,
   I want to be able to make my ICON flash to attract the users attention,
something like the way the RECORDER program flashs its icon. Does anyone
have any ideas.

I have posted this question twice already and have not recieved any replies,
I'm sure someone out there knows the answer.

-- 
Rakesh Kumar Tandon          :  email - rkt@bj.co.uk
Boldon James Limited         :  phone - 0260 280465
Damian House, West Street    :  fax   - 0260 298030
CONGLETON, Cheshire          :

pjr@pyra.co.uk (Peter Ruczynski) (04/26/91)

In article <1352@bjcong.bj.co.uk> rkt@bjcong.bj.co.uk (RAKESH TANDON) writes:
>Hi,
>   I want to be able to make my ICON flash to attract the users attention,
>something like the way the RECORDER program flashs its icon. Does anyone
>have any ideas.
>
>I have posted this question twice already and have not recieved any replies,
>I'm sure someone out there knows the answer.

Ok,
	this is all theory and I haven't tried programming this but
this is what I think the recorder app is doing when it is flashing
its icon.

Firstly lets look at what spy tells us:

0000 WM_TIMER			00DF 0A9DOOC2		erase sequence
5078 WM_ICONERASEBKGND	0846 00000000

0000 WM_TIMER			00DF 0A9DOOC2		paint sequence
5078 WM_PAINTICON		0001 00000000
5078 WM_ICONERASEBKGND	0836 00000000
50BC WM_NCPAINT			0001 00000000

Where:
	5078 is the parent (main) window
	50BC is the list box within the main window

From this we can deduce that recorder sets up a simple timer (ie no
timer callback function) and on receipt of alternate WM_TIMER sends messages
to itself which then erase and paint the icon.

I would guess that recorder isn't doing anything fancy with these messages,
just passing them to DefWindowProc.  However, to erase the icon I think you
need to InvalidateRect the icon window (Main window of the app).  Painting
the icon you just pass the message on similarly with the second
WM_ICONERASEBKGND, which I guess fills in the background around the icon.

I think the NCPAINT message can be ignored. It seems to be going to the
list box, why I can't think!

Hope this is useful, anyone have any other ideas??

Pete.

>Rakesh Kumar Tandon          :  email - rkt@bj.co.uk


--
      -w---------    Pyramid Technology U.K.       Peter Ruczynski    
    ---www-------    Pyramid House                 #include <std/disclaimer.h>
  -----wwwww-----    Farnborough                   pjr@pyra.co.uk
-------wwwwwww---    Hants GU14 7PL     England.   Wot no funny comment :-)

press@venice.SEDD.TRW.COM (Barry Press) (04/26/91)

In article <1352@bjcong.bj.co.uk> rkt@bjcong.bj.co.uk (RAKESH TANDON) writes:
>   I want to be able to make my ICON flash to attract the users attention,
>something like the way the RECORDER program flashs its icon. Does anyone

Try not setting up any icon -- that way, you'll get messages that let you
paint yourself when iconized.  Then set a timer and paint what you choose
(including, for instance, an icon).  Look at the source for clock.

-- 
Barry Press                                 Internet: press@venice.sedd.trw.com

kensy@microsoft.UUCP (Ken SYKES) (04/29/91)

Big drum-roll,  "dadadadadadadada..."  <Clash>

Call FlashWindow.  Do you have an SDK?

Ken Sykes
Disclaimer: The above opinions are solely my own.

chrisr@cognos.UUCP (Christine Roine) (04/30/91)

To find out how to flash an icon, look up the function FlashWindow()
in your SDK manual.  Use FlashWindow and a timer to flash your window
(iconized or normal) multiple times.

-- 
Christine Roine          Cognos Incorporated     S-mail: P.O. Box 9707
Voice: (613) 738-1338 x6205                              3755 Riverside Drive
  FAX: (613) 738-0002                                    Ottawa, Ontario
 UUCP: mitel!cunews!cognos!chrisr                        CANADA  K1G 3Z4

risto@tuura.UUCP (Risto Lankinen) (05/02/91)

rkt@bjcong.bj.co.uk (RAKESH TANDON) writes:

>Hi,
>   I want to be able to make my ICON flash to attract the users attention,
>something like the way the RECORDER program flashs its icon.

Hi-Ho!

From the 'WINHELP SDKWIN.HLP' for the function FlashWindow() :

 " If the window is iconic, FlashWindow will simply flash the icon; " ...

Terveisin: Risto Lankinen
-- 
Risto Lankinen / product specialist ***************************************
Nokia Data Systems, Technology Dept *  2                              2   *
THIS SPACE INTENTIONALLY LEFT BLANK * 2 -1 is PRIME!  Now working on 2 +1 *
replies: risto@yj.data.nokia.fi     ***************************************