For example, on my screen there is a string "abcd"
how can I find the cursor of a and record it ?
For example, on my screen there is a string "abcd"
how can I find the cursor of a and record it ?
If you're in the Windows environment, maybe the following snippet could be of some help to you.
Code:#include <windows.h> int main(void) { DWORD dwX, dwY; HANDLE hOut; CONSOLE_SCREEN_BUFFER_INFO sbSize; COORD Where; DWORD NumRead; char cCharacter; char cCheckCharacter = 'X'; hOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleScreenBufferInfo(hOut, &sbSize); for (dwY = 0; dwY < sbSize.srWindow.Bottom; dwY++) for(dwX = 0; dwX < sbSize.srWindow.Right; dwX++) { Where.X = dwX; Where.Y = dwY; ReadConsoleOutputCharacter(hOut, &cCharacter, 1, Where, &NumRead); if(cCharacter == cCheckCharacter) // dwX, dwY coordinate Beep(400, 1000); } return 0; }
::FROM THE HIP::
If you are in Linux, you may be able to get the current buffer from /dev/mem or /dev/kmem. The location is around 0xb000 (I think). Since Linux runs in protected mode, there should be some residual chars left in the buffer. . . you'd just have to do some research on it.
I ususally just use my eyes when I'm looking for the cursor. I'm not sure I like or understand the whole "from the hip" thing. Maybe your have a touch screen monitor and if so, I'm not so sure I like where you're going with this conversation...Originally Posted by Kennedy
Quzah.
Hope is the first step on the road to disappointment.
I'll overlook that and assume you aren't from the US thus haven't seen enough westerns in your time and tell you the whole phrase is "shooting from the hip" and refers to not having a good bead on the target. . . in other words I was only "taking a stab at it" or "flying by the seat of my pants" perhaps even, "not looking before I leap".
I'll overlook that and assume you have absolutely no sense of humour.Originally Posted by Kennedy
Quzah.
Hope is the first step on the road to disappointment.
Hmmm, smell, touch, taste, hearing, and sight. . . all checks out. . . "Funny" I cannot locate my humour sense.