July 4th, 2012, 05:40 AM
SetWindowText is removing & charatcter in a string.
Im passing "& temp1 & temp2" string as a parameter to SetWindowText("& temp1 & temp2"). not sure why it sets the text as temp1 temp2. & character is getting removed.
Last edited by resumurof; July 4th, 2012 at 06:03 AM.
July 4th, 2012, 06:18 AM
Re: SetWindowText is removing & charatcter in a string.
That is because for certain classes of windows, the '&' denotes that the next letter is the "shortcut" letter (the letter that is underlined in a button, for example).
Originally Posted by resumurof
So as an example, if the window was a button, using SetWindowText("C&ancel") will have the 'a' underlined, which means that the 'a' is the hotkey/shortcut. To actually place an ampersand as text, you use two successive ampersands.
SetWindowText("&& temp1 && temp2");
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!