• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 173
  • Last Modified:

Question for Answer2000!

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?
0
softyan
Asked:
softyan
  • 2
1 Solution
 
Answers2000Commented:
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 ;
}

0
 
softyanAuthor Commented:
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?
0
 
Answers2000Commented:
1. Get the Charles Petzold book - for Win32 API/SDK programming

http://www.amazon.com/exec/obidos/ASIN/1556156766/answers2000limit

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 :

http://www.amazon.com/exec/obidos/ASIN/1556159021/answers2000limit


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.




0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now