Loop in dialog app...

This is a discussion on Loop in dialog app... within the Windows Programming forums, part of the Platform Specific Boards category; I've created a dialog window with a modified "static text" which should show how many times a button (C in ...

  1. #1
    Registered User
    Join Date
    Aug 2006
    Posts
    11

    WM_KEYDOWN in dialog app...

    I've created a dialog window with a modified "static text" which should show how many times a button (C in this case) is pressed by checking it with a WM_KEYDOWN message by using the OnKeyDown()-function. The problem is that nothing is showed on the dialog screen.

    Code:
    void CTry_5Dlg::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
    	// TODO: Add your message handler code here and/or call default
    	char lsChar;
    	lsChar = char(nChar);
    
    
    
    	if (lsChar == 'C') {
    		m_iCount.Format("%d", count);
    		count++;
    		UpdateData(FALSE);
    	}
    	
    
    	
    	CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
    }
    Can anyone explain how I should solve this problem?

    (Yes, I'm a newbie in VC++)
    Last edited by xkrja; 11-09-2006 at 06:52 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. A somewhat bizzare problem!!! - WHILE LOOP
    By bobthebullet990 in forum C Programming
    Replies: 3
    Last Post: 03-31-2006, 07:19 AM
  2. syntax question
    By cyph1e in forum C Programming
    Replies: 19
    Last Post: 03-31-2006, 12:59 AM
  3. best program to start
    By gooddevil in forum Networking/Device Communication
    Replies: 4
    Last Post: 05-28-2004, 06:56 PM
  4. Getting the position of a dialog without parent on the screen
    By stormbringer in forum Windows Programming
    Replies: 1
    Last Post: 08-27-2003, 03:59 AM
  5. SDI Menu App - MSVC 6
    By Unregistered in forum Windows Programming
    Replies: 7
    Last Post: 10-16-2001, 10:59 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21