So I imagine that you want to pop-up some little window that holds the ddlb / dddw ?
If your "Edit style box" is multi-line, it's not going to be easy to figure out at which x and y-position you would have to pop up that little window: You can get the position of the cursor in the text, but you don't know if for example position 100 is on line 1, 2 or 3 and depending of the width of your edit column/control, position 100 could be more to the right or left, etc. It would also depend on font sizes, fonts themselves, what text has been typed ("III" takes up less width than "ABC"), etc.
If your "Edit style box" is single-line, it might be possible to figure out at which x and y-position you would have to pop up that little window: For the Y position, you can look at the Y of the dw control, add the Y position of the column and/or consider on which row you're editing and sum a certain amount of height per row.
You can get the X position of the cursor by first reading all the text on the left of the cursor position. Then, depending on font, font-size and contents of the actual text that you just read, it should be possible to calculate the width of that text. Years ago, I heard of some library called 'Latex' to do stuff like that. Roland Smith has some example on his website to manage auto width columns https://www.topwizprogramming.com/freecode_dwgridxp.html. Maybe there's something there you could use.
Or ... what I'm thinking: Would it work if you have some "hidden" column somewhere, with 'auto-size width" set to true and assign the "left-text" to it and then read the width?
The 2 API functions suggested by Ren'e look very promising too, but even if I'd be able to get the coordinates relative to the screen, I wouldn't know of an easy way to convert that to the powerbuilder x and y values you need. (It should be possible, but I know too little of DPI and pixel widths depending on monitors, etc.).
Just ideas ...
regards
Like you, I'd love to have a built-in PowerBuilder function that returns the X and Y coordinates of the cursor within the current window:
ll_rc = window.CursorPosition (x pos, y pos)
Even better would be a version that works on any visual object:
ll_rc = visual_object.CursorPosition (x pos, y pos)