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 10,691 of 10,840   
   Bill McCarthy to Don   
   Re: Get Control IDs more efficiently   
   06 Dec 08 16:21:42   
   
   XPost: microsoft.public.vb.general.discussion, microsoft.public.vb   
   From: Bill@localhost.com   
      
   Hi Don,   
      
   You use those same functions to recurse children of children.  You won't get   
   all controls, such as labels; only those that have windows.   
      
      
   "Don"  wrote in message   
   news:49394812.3110859@news.west.cox.net...   
   > Regarding the two suggestions offered so far, I see I wasn't clear in   
   > my original post..   
   >   
   > I'm using EnumWindows and EnumChildWindows to get all the window   
   > handles and their IDs which works fine.  But it's all the controls   
   > inside each window for which I need their IDs (text boxes, command   
   > buttons, etc.).  Creating a loop to test all possible ID numbers does   
   > work, but it would be much better if there an equivalent of the   
   > EnumWindows function that also enumerates all the control IDs inside   
   > the window.   
   >   
   > Don   
   >   
   > On Thu, 04 Dec 2008 21:07:40 GMT, dsarvas@yahoo.com (Don) wrote:   
   >   
   >>I'm using the GetDlgItem function to get the text from a specific   
   >>control in external apps.  Works fine, but if I don't know the control   
   >>ID, I create a loop (e.g. 0 to 100) to test all the control IDs in   
   >>that range to find the control.  Problem is that a control can have a   
   >>very large number as the ID and I enumerate through all windows and   
   >>their child windows so that can create a little more delay than I want   
   >>and I would never be sure my loop is a range that covers the highest   
   >>control ID number.   
   >>   
   >>Is there an API function or a way to grab all the control ID numbers   
   >>on a window rather than looping through a range of numbers to find a   
   >>control that matches that ID number?   
   >>   
   >>Thanks,   
   >>Don   
   >   
      
   --- 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