Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

delphi Ñ¡ÔñÎļþ¼Ð


function BrowseCallbackProc(Wnd: HWND; uMsg: UINT; lParam, lpData: LPARAM): Integer; stdcall;
begin
if uMsg = BFFM_INITIALIZED then
begin
SendMessage(Wnd, BFFM_SETSELECTION, 1, lpData);
SetWindowText(Wnd, 'Ñ¡ÔñÒ»¸öÄ¿±ê');
end;
Result := 0;
end;
//hdl: ´°¿Ú¾ä±ú
//Root: ¸ùĿ¼
//InitDir: ³õʼ»¯Â·¾¶
//Hint: ¶Ô»°¿òÌáʾÓï¾ä
function fBrowseFolder(hdl:THandle; const Root: String; const InitDir: string;
Hint: string = 'ÇëÑ¡ÔñÎļþ¼Ð'): string;
var
Info:TBrowseInfo;
Dir:array[0..260] of char;
ItemId, RootItemIDList:PItemIDList;
Eaten, Attribute: Cardinal;
ID: IShellFolder;
begin
FillChar(Info, SizeOf(TBrowseInfo), #0);
with Info do
begin
hwndOwner := hdl;
SHGetDesktopFolder(ID);
ID.ParseDisplayName(hdl, nil, POleStr(WideString(Root)), Eaten, RootItemIDList, Attribute);
pidlRoot := RootItemIDList;
pszDisplayName := nil;
lpszTitle:= PChar(Hint);
ulFlags:=BIF_RETURNONLYFSDIRS + BIF_NEWDIALOGSTYLE; //Èç²»ÐèҪн¨°´Å¥£¬Ò²¿É²»¼ÓBIF_NEWDIALOGSTYLE
lpfn := BrowseCallbackProc;
lParam := Integer(PChar(InitDir));
iImage := 0;
end;
ItemId := SHBrowseForFolder(Info);
if ItemId<>nil then
begin
SHGetPathfromIDList(ItemId,@Dir);
GlobalFreePtr(ItemId);
Result:=string(Dir);
end
else
Result:='';
end;


Ïà¹ØÎĵµ£º

Delphi ´ò¿ªÎļþ¼Ð·½·¨

µÚÒ»ÖÖ·½·¨,ʹÓÃSelectDirectory º¯Êý ,ÔÚShellApiÖÐ
procedure TForm2.BtSelectPathClick(Sender: TObject);
var
    strCaption,strDirectory:String;
    wstrRoot:WideString;
    begin
    strCaption:='ÕâÊÇä¯ÀÀÎļþ¼ÐµÄ˵Ã÷ÎÄ×Ö£¬¿ÉÒÔ¸ù¾ÝÐèÒª½ ......

delphi±àÂë¹æ·¶Îĵµ

delphi±àÂë¹æ·¶Îĵµ
Ŀ¼
1¡¢Ç°ÑÔ 3
2¡¢Ô´³ÌÐòÊéд¹æ·¶ 3
2.1ͨÓÃÔ´´úÂë¸ñʽ¹æ·¶ 3
2.1.1Ëõ½ø 3
2.1.2±ß¾à 3
2.1.3 Begin…EndÓï¾ä 3
2.1.4×¢ÊÍ 4
2.2 OBJECT PASCALÓï¾ä¸ñʽÊéд¹æ·¶ÓëÓ÷¨ 4
2.2.1À¨ºÅ 4
2.2.2±£Áô×ֺ͹ؼü×Ö 4
2.2.3¹ý³ÌºÍº¯Êý 5
2.2.4±äÁ¿ 5
2.2.5ÀàÐÍ 6
2.2.6Óï¾ä 6
2.2.7½á¹¹» ......

¹ØÓÚdelphiÖÐitemsºÍitemindexµÄÎÊÌâ

Ë÷ÒýÊÇitemindex
itemÊÇÀïÃæµÄÄÚÈÝ
Ë÷ÒýµÄ»°£¬ÊÇ´Ó0¿ªÊ¼
item   itemindex
A      1
B      2
C      3
listbox1.items.count¾ÍÊÇÕâ¸öÁбí¿òÀï×ܹ²ÓжàÉÙÏî. ......

▼¡øDelphiÃæÏò¶ÔÏó±à³ÌµÄ20Ìõ¹æÔò

▼¡øDelphiÃæÏò¶ÔÏó±à³ÌµÄ20Ìõ¹æÔò(×ªÔØ)
Â¥Ö÷ZyxIp£¨¾øÍûÖÐ...£©2003-09-02 14:28:07 ÔÚ Delphi / VCL×é¼þ¿ª·¢¼°Ó¦Óà ÌáÎÊ
×÷Õß¼ò½é    
  Marco   CantuÊÇÒ»¸öÖªÃûµÄDelphiר¼Ò£¬ËûÔø³ö°æ¹ý¡¶¾«Í¨Delphi¡·ÏµÁдÔÊ飬¡¶Delphi¿ª·¢ÊֲᡷÒÔ¼°µç×ÓÊé¡¶¾«Í¨Pascal¡·(¸Ãµç×ÓÊé¿ÉÔÚÍøÉÏÃâ·Ñ»ñµÃ)¡ ......

Delphi Äܲ»ÄÜ´ÓRing 3½øÈëRing 0

Delphi Äܲ»ÄÜ´ÓRing 3½øÈëRing 0?
Â¥Ö÷skyworld_xm£¨skyworld£©2004-11-19 09:58:55 ÔÚ Delphi / Windows SDK/API ÌáÎÊ
Delphi   Äܲ»ÄÜ´ÓRing   3½øÈëRing   0?  
  ÓÐÀý×ÓÂð?  
  ¶àл. ÎÊÌâµãÊý£º100¡¢»Ø¸´´ÎÊý£º20Top
1 Â¥jinjazz£¨½üÉí¼ô£©»Ø¸´ÓÚ 2004-11-19 10:13:27 µÃ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ