0

I have a rectangular region;

RECT rc{474,0,674,185};
//or
HRGN hrgn=CreateRectRgn(474,0,674,185);

I want to move (like cut and paste) the contents (all the controls) of this region to some rectangle with coordinates {0,0,200,185} so how do I do that?

P.S: I'm overwriting this question onto another, please answer it.

  • 3
    You can achieve that by writing some C++ code that uses `std::getline`, followed by parsing the resulting string accordingly. Or, in several other ways, but we don't write programs for other people, here on stackoverflow. You should find plenty of examples in your C++ book of reading user input and parsing it. Don't forget about error checking. – Sam Varshavchik Mar 28 '20 at 21:18
  • Where can I find such examples online? –  Mar 28 '20 at 21:26
  • Search "c++ parse file" "c++ read commands from file" or similar. Part of becoming a developer is learning to search. Often for a big problem you must break it in to separate pieces then search for how to do each piece. – Dave S Mar 28 '20 at 21:30
  • You are not going to find a lot of high quality examples "online". The only way to learn C++ very well, [is with a good book](https://stackoverflow.com/questions/388242/the-definitive-c-book-guide-and-list). Any clown can put together a web site and write anything off the top his mind. It takes time and effort to write a book, and sell it; hence you will find books to be much better for learning C++ than Youtube videos or random web sites. – Sam Varshavchik Mar 28 '20 at 21:31
  • ^ that works too :) . At least as long as you can afford the book, some learners need free, – Dave S Mar 28 '20 at 21:32
  • To wrap c++ functions to an parser you can use swig. This enables you to add you c++ functions to any scripting language you want. And like in wish/tlcsh, you have a full command line editor/parser and can write script progs. Maybe an idea... – Klaus Mar 28 '20 at 23:14
  • 1
    Do not overwrite one question with another. (1) It invalidates all previous discussion. (2) It prevents people who had the original question from finding it. If you want to ask a new question, then ask a new question. – Raymond Chen Jul 11 '20 at 13:51
  • I can't ask new questions, that's why. Also the previous question is insignificant that's why there is nothing wrong with overwriting on it. If you wrote an actual answer, you would've actually help. Your comment simply doesn't help, and is as insignificant as my former question. –  Jul 11 '20 at 15:17

1 Answers1

1

In your case, you should use std::getline to get the text on an input string.

e.g.

map<string, FuncType> m;
std::string text;
std::getline (std::cin, text);
m[text] = translate;
// Convert argv[2] to integer:
int x = atoi(argv[2]);
// Call function indicated by argv[1]:
m[argv[1]](x);

If I read your question incorrectly, then correct me.

appledoes
  • 113
  • 9