home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!wupost!sdd.hp.com!elroy.jpl.nasa.gov!nntp-server.caltech.edu!vex!hihunn
- From: hihunn@vex.ugcs.caltech.edu (Heath I Hunnicutt)
- Newsgroups: comp.os.ms-windows.programmer.misc
- Subject: Re: Change App's Icon On The Fly
- Message-ID: <hihunn.714274051@vex>
- Date: 20 Aug 92 01:27:31 GMT
- References: <1992Aug17.235109.17512@cco.caltech.edu> <1992Aug18.141851.25525@ods.com>
- Sender: news@cco.caltech.edu
- Organization: California Institute of Technology, Pasadena
- Lines: 23
- Nntp-Posting-Host: vex.ugcs.caltech.edu
-
- Here is some working code to change an icon on the fly.
-
- This has been compiled using Turbo C++ 3.0.
-
- One thing that might be causing trouble is using an old window.h with
- Windows 3.1. According to Undocumented Windows (Schulman, et al. - Addison
- Wesley) , the various GCW_ xxx constants changed with 3.1. I guess
- that means you have to do version checking around your calls to
- Get|Set Window|Class Word|Long.
- ---CUT HERE---
- if (Flashing) {
- if (GetClassWord(hWnd,GCW_HICON)==HIconRed)
- SetClassWord(hWnd,GCW_HICON,HIconGreen);
- else
- SetClassWord(hWnd,GCW_HICON,HIconRed);
- InvalidateRect(hWnd,NULL,TRUE);
- }
- ---END CODE---
-
- For the record, my GCW_HICON equals -14.
-
- Good luck,
- Heath
-