Question for Answer2000!

Posted on 1998-10-20
Last Modified: 2010-04-15
Hi Answer2000,
   The "blinking text" code segment that u give me can only implement it at the beginning of a program, when the dialog
display, the text blinking. How if i want to blink the text only if i press the button?
Question by:softyan
  • 2

Accepted Solution

Answers2000 earned 70 total points
ID: 1253712
Modify Step 2 of my original answer (you did see my comment on colors too ??? - login and click on your name, and then the other Question to see the comment I added)

remove this line from WM_INITDIALOG case

   uTimerId = SetTimer( hDlg, 1, 1000 /* Time in Millisecs */, NULL ) ;

add a case WM_COMMAND :-

i. To start flashing - assuming ID_BUTTON1 is the button for this

if (LOWORD(wParam) == ID_BUTTON1 )
  // kill prev timer
   if ( uTimerId != 0 ) KillTimer( uTimerId ) ;
   uTimerId = 0 ;

   uTimerId = SetTimer( hDlg, 1, 1000 /* Time in Millisecs */, NULL ) ;

ii. To stopflashing - assuming ID_BUTTON2 is the button for this

if (LOWORD(wParam) == ID_BUTTON2 )
  // kill prev timer
   if ( uTimerId != 0 ) KillTimer( uTimerId ) ;
   uTimerId = 0 ;


Author Comment

ID: 1253713
I did read the set colour answer, and it is great. My program work fine, and here is the point. BTW, i would like to know where can i get more information or knowledge on the windows message system? Any suggestion?

Expert Comment

ID: 1253714
1. Get the Charles Petzold book - for Win32 API/SDK programming

Tonnes of samples (not fantastic code - some duplication - but easy to read).  Covers all the core Windows API (one chapter on OLE - which is a waste of time).  

All the customer comments tell you it's a good book (and I'd recommend it too) - except for the guy who tells you to learn MFC or VB instead

Even if you switch to MFC in future, get this book too for background, as MFC builds on top of the Win32 API

2. In case you move on to MFC later, Jeff Prosise has done the best introductory book I've seen on MFC :

3. The links are from Amazon and both books have discounts.

If you decide to buy online, please use my links from above (normal cost - you still get the same discount from Amazon), but my site gets referral credit.


Featured Post

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and writing to files in the C programming language.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now