How can I access combo box list items?

sajjut
sajjut used Ask the Experts™
on

Most of the combo box I am getting combo list items using CB_GETLBTEXTLEN,CB_GETCOUNT,and CB_GETLBTEXT. But combo box in Internet explorer (address combo box), Find window combo box (Look in combo Box where we specifies the path)etc, I am not able to get the list items.
Can anybody help me please?
Sajju
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
If you want to collec visited URL you hacve to do it using FindFirstUrlCacheEntry, and FindNextUrlCacheEntry. I can post an example , but only  at evening from home. I don't have free time right now to recreate it.
procedure TForm1.FormCreate(Sender: TObject);
label again,ex;
var a:PInternetCacheEntryInfoA;
    dwEntrySize:Dword;
    hCacheDir:THandle;
    lastError:longint;
    s:string;
    Ts:TStringList;
begin
     Ts:=TStringList.Create;
     ts.Sorted:=true;
     dwEntrySize := MAX_CACHE_ENTRY_INFO_SIZE*1000;
     GetMem(a,dwEntrySize);
     a.dwStructSize:=dwEntrySize;

     hCacheDir:=FindFirstUrlCacheEntryEx('visited:',0,URLCACHE_FIND_DEFAULT_FILTER,0,a,@dwEntrySize,nil,nil,nil);
     if hCacheDir<>0 then
     begin
           s:=a.lpszSourceUrlName;
           s:=copy(s,pos('@',s)+1,length(s));
           ts.add(s);
           FreeMem(a,dwEntrySize);
           GetMem(a,dwEntrySize);
           again:

           if not FindNextUrlCacheEntryEx(hCacheDir,a,@dwEntrySize,nil,nil,nil) then
           begin
                lastError:=GetLastError() ;
                case lastError of
                     ERROR_NO_MORE_ITEMS:begin
                                         FindCloseUrlCache(hCacheDir);
                                         goto ex;
                                         end;
                     ERROR_INSUFFICIENT_BUFFER:begin
                                                    FreeMem(a);
                                                    GetMem(a,dwEntrySize);
                                                    goto again;
                                                    end
                     else begin
                          FindCloseUrlCache(hCacheDir);
                          ShowMessage(IntToStr(lastError));
                          goto ex;
                     end;
                end;
           end else
           begin
                s:=a.lpszSourceUrlName;
                s:=copy(s,pos('@',s)+1,length(s));
                if (a.dwHitRate>10) and (copy(s,1,5)='http:') then
                begin
                ts.add(s);
                end;
                FreeMem(a,dwEntrySize);
                GetMem(a,dwEntrySize);
                goto again;
           end;

     end;
     ex:
     FreeMem(a,dwEntrySize);
     Edit1.Items.Assign(ts);
     ts.Free;
end;
sajjut:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial