Click here to Skip to main content
11,432,627 members (64,581 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ MFC VC9.0 VC VC++
 case WM_COMMAND:    
            switch (LOWORD (wParam))
            {
				case IDC_PLAY:
					static char textmessage[256];
					SendMessage((HWND)lParam,WM_GETTEXT,(WPARAM)256,(LPARAM)textmessage);
					MessageBox(NULL,textmessage,NULL,NULL);
					if(textmessage=="PLAY")
					{
                                         SetWindowText((HWND)lParam,"Stop");
 
					}
					
				


I am not entering in to the if though its "PLAY";
How to compare exactly this. I am new to use such cases for WM_COMMAND and sendMessage
Posted 9-May-12 1:54am
chaiein1.8K
Edited 9-May-12 1:57am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

change

from
if(textmessage=="PLAY")

to
if( strncmp(textmessage, "PLAY", 4) == 0 )


(or use a CString).
  Permalink  
Comments
chaiein at 9-May-12 7:46am
   
Thank you:) it works
CPallini at 9-May-12 7:54am
   
Are you surprised? :-D
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 9 May 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100