|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
GetCaretPos in a MDI WindowI know how to get caret position in SDI environment using vb6. But it is always returning (0,0) position in a mdi interface (e.g. IE7, Firefox), although the caret is not there. How can I solve this problem? Thanks in advance for your kind help. Here is the code: ------------------------------------------------------------------------ hwndFG = GetForegroundWindow() If hwndFG <> 0 Then TID = GetWindowThreadProcessId(hwndFG, ByVal 0&) If TID <> App.ThreadID Then If AttachThreadInput(App.ThreadID, TID, 1) <> 0 Then hwndFoc = GetFocus() If hwndFoc <> 0 Then If GetCaretPos(Position) <> 0 Then GetCaretPos Position ClientToScreen hwndFoc, Position FindCaretPosWindow = hwndFoc End If End If AttachThreadInput App.ThreadID, TID, 0 End If End If End If ----------------------------------------------------------------------- On Mar 2, 1:24 pm, omicron***@gmail.com wrote:
Show quoteHide quote > Hello, Anyone?> I know how to get caret position in SDI environment using vb6. > But it is always returning (0,0) position in a mdi interface (e.g. > IE7, Firefox), although the caret is not there. How can I solve this > problem? > > Thanks in advance for your kind help. > > Here is the code: > > ------------------------------------------------------------------------ > hwndFG = GetForegroundWindow() > > If hwndFG <> 0 Then > TID = GetWindowThreadProcessId(hwndFG, ByVal 0&) > If TID <> App.ThreadID Then > If AttachThreadInput(App.ThreadID, TID, 1) <> 0 Then > hwndFoc = GetFocus() > If hwndFoc <> 0 Then > If GetCaretPos(Position) <> 0 Then > GetCaretPos Position > ClientToScreen hwndFoc, Position > FindCaretPosWindow = hwndFoc > End If > End If > AttachThreadInput App.ThreadID, TID, 0 > End If > End If > End If > ----------------------------------------------------------------------- On 1 Mar 2007 23:24:24 -0800, omicron***@gmail.com wrote:
Show quoteHide quote >Hello, Well that code will not even try to get the Caret position if that App>I know how to get caret position in SDI environment using vb6. >But it is always returning (0,0) position in a mdi interface (e.g. >IE7, Firefox), although the caret is not there. How can I solve this >problem? > >Thanks in advance for your kind help. > >Here is the code: > >------------------------------------------------------------------------ >hwndFG = GetForegroundWindow() > > > > If hwndFG <> 0 Then > TID = GetWindowThreadProcessId(hwndFG, ByVal 0&) > If TID <> App.ThreadID Then > If AttachThreadInput(App.ThreadID, TID, 1) <> 0 Then > hwndFoc = GetFocus() > If hwndFoc <> 0 Then > If GetCaretPos(Position) <> 0 Then > GetCaretPos Position > ClientToScreen hwndFoc, Position > FindCaretPosWindow = hwndFoc > End If > End If > AttachThreadInput App.ThreadID, TID, 0 > End If > End If > End If >----------------------------------------------------------------------- is the Foreground Application.
Stop loading data process
Application crashing - trying to track down the problem. Data Type String VB6 App Deployment in Vista Problems after installing Visual Basic 6 on XP Professional SP2 Convert decimal to fraction string Looking for an easy way to achive this problem. VB6 User Control next problem Autologon on Vista email attachments? |
|||||||||||||||||||||||