home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.visual.basic      MS Visual Basic discussions, NOT dot-net      10,840 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 9,843 of 10,840   
   Jay Taplin to Apach   
   Re: Get text from edit box   
   16 Jan 06 19:05:17   
   
   XPost: comp.lang.basic.visual   
   From: jtaplin@integraware.com   
      
   I knew I had done this before.  Thanks to Randy Birch's post below, he   
   reminded me that there was a much easier way.  I found my code, so here it   
   is:   
      
   Public Function GetText(hwnd As Long) As String   
       Dim strTemp As String   
       Dim lngLength As Long   
      
       lngLength = SendMessage(hwnd, WM_GETTEXTLENGTH, ByVal 0, ByVal 0)   
      
       strTemp = Space(lngLength)   
      
       SendMessage hwnd, WM_GETTEXT, ByVal lngLength + 1, ByVal strTemp   
      
       GetText = strTemp   
   End Function   
      
   "Apach"  wrote in message news:dqh2jn$ine$1@bagan.srce.hr...   
   > Hellou!   
   >   
   > Please can anybody tell me how to Get text from edit box in some window   
   > (etc. notepad) if i have HWND of this edit box.   
   >   
   > I try by using GetWindowText API butt this API return text only if this   
   > text is caption of some window in title bar.   
   >   
   > Thanks!   
   >   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca