Ali Imran
June 13th, 2005, 05:14 PM
Question is regarding richedit control
Note: Index must be zero-based. And hwnd is the handle to richedit control.
1. I require a funtion to get global position of cursor in a rich edit control (not the mouse cursor but text cursor), something like
int getCursorPos(HWND hwnd) {
return current character index where cursor is located
}
2. get index of first character in current line
int getLineFirstCharPos(HWND hwnd) {
return index of first character in current line where cursor is located
}
3. get current line number
int getLineNumber(HWND hwnd) {
return current line number where cursor is located
}
4. total number of lines
int getTotalLines(HWND hwnd) {
return Total number of lines
}
5. total number of characters
int getTotalChars(HWND hwnd) {
return Total number of characters in richedit
}
EDITTED
Sory need one more function
6. get index of last character in current line
int getLineFirstCharPos(HWND hwnd) {
return index of last character in current line where cursor is located
}
I have posted few qeustions before, and I could not explain better.
I hope it is not considered spam since post does not include any link.
Waiting for kind urgent reply (if posible).
regards
Note: Index must be zero-based. And hwnd is the handle to richedit control.
1. I require a funtion to get global position of cursor in a rich edit control (not the mouse cursor but text cursor), something like
int getCursorPos(HWND hwnd) {
return current character index where cursor is located
}
2. get index of first character in current line
int getLineFirstCharPos(HWND hwnd) {
return index of first character in current line where cursor is located
}
3. get current line number
int getLineNumber(HWND hwnd) {
return current line number where cursor is located
}
4. total number of lines
int getTotalLines(HWND hwnd) {
return Total number of lines
}
5. total number of characters
int getTotalChars(HWND hwnd) {
return Total number of characters in richedit
}
EDITTED
Sory need one more function
6. get index of last character in current line
int getLineFirstCharPos(HWND hwnd) {
return index of last character in current line where cursor is located
}
I have posted few qeustions before, and I could not explain better.
I hope it is not considered spam since post does not include any link.
Waiting for kind urgent reply (if posible).
regards