Ctrl+z???

Hi!

I am programming an application to send SMS using a module GSM. After write the text I have to "press" Ctrl+Z (end of file).

How Can I do it in my application (I use Visual C++ 6.0)

Thanks!




Answer this question

Ctrl+z???

  • Jondr

    Assuming you're doing this programmatically rather than typing it in with the keyboard: Ctrl+Z is character code 0x1A.



  • notnal

    So, if I write something like

    sprintf(msg , "AT+CMGS=This is the sms0x1A ",m_strPhonenumber);

    is correct ( I want to send a n "AT command" to send an SMS and at the end of the message I have to "press Ctrl-Z")

    Thanks!



  • Kunj

    In the .NET world we’ve got the SendKeys.Send() method available to us... in the VC6 world your best bet would likely be with keybd_event(). Take a look at this Code Project tutorial that uses it and works in VC6.

  • Tea

    Thanks for all!!!

    The space is a wrong...and I fotget to write %s but I knew it, don't worry.

    My only question was about the format of "0x1A" but now it's ok. So, I will try to use it and if I have some problems I ask again(I don't think that it will be necessary)



  • PerryMowbray

    Close. Write it like this:
    sprintf(msg , "AT+CMGS=This is the sms\x1A ");
    or this:
    #define CTRLZ 0x1A
    sprintf(msg , "AT+CMGS=This is the sms%c ", CTRLZ);

    Note: you've got an extra space after the CTRL+z, intentional Use %s in the format string to insert the phone number.



  • Ctrl+z???