...suppose the thread title sums it up!
...suppose the thread title sums it up!
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
& orCode:GetWindowText( HWND hWnd, // handle to window or control LPTSTR lpString, // text buffer int nMaxCount // maximum number of characters to copy );Code:GetDlgItemText( HWND hDlg, // handle to dialog box int nIDDlgItem, // control identifier LPTSTR lpString, // pointer to buffer for text int nMaxCount // maximum size of string );
Last edited by polo; 06-25-2002 at 02:43 PM.
Actually, what I meant is how to highlight the text. As if the user had dragged the mouse over the text while holding down the left mouse button...BTW: thanks for the quick response though!
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Hmm.....have a try at..
Code:SendMessage(hEdit, EM_SETSEL, (WPARAM)nFirstChar,(LPARAM) nLastChar);
Hmm...interesting. That didn't work but you gave me a great starting point! Your suggestion led me directly to the windowsx.h header. What an interesting file! I will be back with a definite...thanks Rob...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Hmm didnt work huh?.....It should do.....it will highlight the selected range within an edit........I assume that's what you want right?
BTW, there are loads of EM_ messages you can send to an edit......have a look at the SDK docs for more info...
Ahh, well that file was a bum one. Just a bunch of cheap macros! Anyhow, I believe you gave the correct code. I am just overlooking something. I will figure it out. Oh and BTW: I am assuming the last two params are pointers to the first and last cells of the buffer that got the window text?
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
This function simply highlights text in an edit just like dragging a mouse over the text with the left button down...that is what you want right?Originally posted by Sebastiani
Ahh, well that file was a bum one. Just a bunch of cheap macros! Anyhow, I believe you gave the correct code. I am just overlooking something. I will figure it out. Oh and BTW: I am assuming the last two params are pointers to the first and last cells of the buffer that got the window text?
The last 2 params are the start and end positions of the text you want highlighted.........simply send ints, but cast them to WPARAM & LPARAM for the purposes of the function...
Oh....and you may need to give the edit input focus before doing this.....
Yes to highlight text.
Here is what I was trying:
eTicker.Focus();
SendMessage(eTicker.hwnd, EM_SETSEL, (WPARAM)buff[0], (LPARAM)buff[strlen(buff) - 1]);
...and even the hard-coded:
eTicker.Focus();
SendMessage(eTicker.hwnd, EM_SETSEL, (WPARAM)'a', (LPARAM)'c');
//...the contents of the edit in that case being "abc"...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
No sorry...you need the numerical index positions....
You dont even need to know the contents of an edit to set selections....Code:int nFirstChar = 1,nLastChar = 3; //....................... eTicker.Focus(); SendMessage(eTicker.hwnd, EM_SETSEL, (WPARAM)nFirstChar, (LPARAM)nLastChar );
Geez I'm a goober. Anyhow, now the effect is that the text is completely erased! Well I will work on that after more important aspects of the program are finished. But I thank you kindly, sir. Let me know if I can be of any assistance to you...
Code:#include <cmath> #include <complex> bool euler_flip(bool value) { return std::pow ( std::complex<float>(std::exp(1.0)), std::complex<float>(0, 1) * std::complex<float>(std::atan(1.0) *(1 << (value + 2))) ).real() < 0; }
Try this
SendMessage(hWnd, EM_SETSEL, 0, MAKELONG(0,0xffff) );
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill