[Solved] open new notepad.exe and write content to it [duplicate]

[ad_1] try this one source [DllImport(“user32.dll”, EntryPoint = “FindWindowEx”)] public static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); [DllImport(“User32.dll”)] public static extern int SendMessage(IntPtr hWnd, int uMsg, int wParam, string lParam); private void button1_Click(object sender, EventArgs e) { Process [] notepads=Process.GetProcessesByName(“notepad”); if(notepads.Length==0)return; if (notepads[0] != null) { IntPtr child= FindWindowEx(notepads[0].MainWindowHandle, new IntPtr(0), … Read more

[Solved] Unique Random Number between 0 and 9

[ad_1] I prefer to use shuffle. #include <algorithm> #include <iostream> #include <random> #include <vector> #include <cassert> class T455_t { private: // data std::vector<int> m_iVec ; public: T455_t() {} int exec() { std::vector<int> iVec; gen10(); for (int i=0; i<10; ++i) { int nxtRandom = uniqueRandomInt(); std::cout << nxtRandom << std::endl; } return(0); } private: // methods … Read more

[Solved] Sum of comma separated string like 4,1,3 by O(n)

[ad_1] OK… We are not a homework solving community here and you’ve got enough comments on the style of your question. Further, your problem does not seem to be C++, but algorithmic. I Hope you learn from it for your next questions. But I find this interesting. Here’s an idea: a) iterate all elements and … Read more

[Solved] this C++ code always gives same output

[ad_1] #include<iostream> #include<conio.h> using namespace std; int main() { int num; cout<<“Enter a number\n”; cin>>num; int n = num; int rev = 0; while( n >= 1 ) { int rem = n%10; rev = (rev*10) + rem; n=n/10; } cout<<“The reverse of given number is:”<<rev<<endl; if(num==rev) cout<<“The given number and its reverse are equal” … Read more

[Solved] c# selenium if else check [closed]

[ad_1] This is what you are asking for if (rows == null) { continue; } else { rows.ElementAt(0).Click(); break; } However it’d be better code practice and more efficient to use a while loop implementation instead; IReadOnlyCollection<IWebElement> rows = null; bool rowsFound = false; while (!rowsFound) { rows = driveri.FindElements(By.XPath(“//*[@id=\”app\”]/div/span[3]/div/div/div/div/div/div/div[2]/div”)); if(rows!=null) { rowsFound = true; … Read more

[Solved] C# Line is horizontal

[ad_1] I have solved the problem using the approach proposed by @MBo taking the difference in height and length. Here is the function: public static bool? isLineVertical(Line line) { double xDiff = Math.Abs(line.X2 – line.X1); double yDiff = Math.Abs(line.Y2 – line.Y1); bool? vertical = null; if (yDiff > xDiff) { vertical = true; } else … Read more

[Solved] program to delete certain text which is predefined in another file from a file in c++

[ad_1] Show some research effort when you post a question here. #include <iostream> #include <unordered_set> #include <fstream> int main() { std::unordered_set<std::string> mySet; std::string word; std::ifstream file1(“myFile1.txt”); if(file1.is_open()) { while(file1 >> word) mySet.emplace(word); file1.close(); } std::ifstream file2(“myFile2.txt”); if(file2.is_open()) { while(file2 >> word) { auto look = mySet.find(word); if(look != mySet.cend()) mySet.erase(look); } file2.close(); } std::ofstream outputFile(“Out.txt”); … Read more

[Solved] C# – Upload video and read QR codes in it

[ad_1] Sounds like there are two parts to this question: 1. Getting an image from a video I suppose you manage to do this since you did not provide any info on the video file format. 2. Detecting a QR code in an image. Multiple options exist: Use the AForgeTry using AForge.NET library for capturing … Read more

[Solved] Compare inline function in std::sort()

[ad_1] Read more about C++11 at least (or C++14 or C++17), e.g. some good C++ programming book (any standard older than C++11 is obsolete, and C++11 has evolved a lot since its predecessors, so you should almost consider C++11 as a new programming language). Look also some C++ reference site. [](const string &left, const string … Read more

[Solved] extract specific string from a file using c++

[ad_1] This sounds like a task for regular expression. In C++ there is support for regex especially regex_match. I guess, this should get you started. But be warned, what you are trying to accomplish will not be solved by simple regex. Your matching string might look something like this /\/function name: ([^\\]*).*/ This will look … Read more

[Solved] C++ operator precedence

[ad_1] The effect is as you write, but it’s achieved using a slightly different sequence: The post-increment has highest precedence, so it’s evaluated first. However, its return value (which is processed by further operators) is the value of iter before the increment. Dereference is evaluated next, returning pointer to which the non-incremented value of iter … Read more

[Solved] What is the meaning of std::stack s1;

[ad_1] The type: std::stack<int,std::vector<int>> means that we wish to construct a stack of integers, with the container for the stack implemented as a vector of integers. More detail, in the unlikely event you need it, can be found here. In other words, create a vector of integers, then wrap the stack type around that. A … Read more

[Solved] How to get the int value last digit of the year? [closed]

[ad_1] There is the Remainder operator in C# The remainder operator % computes the remainder after dividing its left-hand operand by its right-hand operand. int year = formModel.JamKeluar.Year; int aas = year % 1000; Console.WriteLine(aas); 1 [ad_2] solved How to get the int value last digit of the year? [closed]