0

Im using WIN32 API. I want to take an integer lets suppose 1000 as input through an edit box. I am Using sendmessage() function for taking input but it can take only string input. How can I take an integer as input?

Ayse
  • 2,456
  • 9
  • 33
  • 56
  • 2
    Fetch the string, attempt to convert it to an integer. (The ES_NUMBER style may be applied to the control to allow only numeric input (still returned as a string, not guaranteed to be numeric (eg paste))) – Alex K. Mar 15 '13 at 11:42
  • You should read this [convert string to integer sscanf or atoi](http://stackoverflow.com/questions/3420629/convert-string-to-integer-sscanf-or-atoi) – David Heffernan Mar 15 '13 at 13:04

1 Answers1

1

You need to convert the string inputted in edit box to an integer like this e.g.:

int n = atoi(myString);
Leo Chapiro
  • 12,996
  • 7
  • 53
  • 84