Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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Öе÷ÓÃEXEÎļþ


//¼Óһϰ´Å¥£¬¼ÓÒ»¸ö¶Ô»°¿ò¾ÍOKÀ²
procedure TForm1.Button1Click(Sender: TObject);
var
S: String;
begin
if OpenDialog1.Execute then
begin
s := OpenDialog1.FileName;
WinExec( PChar(s), SW_NORMAL);
end;
end;

----------------------- ......

Delphi µÄ Dll º¯ÊýµÄ µ÷ÓÃ


Ò»¡¢Dll½¨Á¢
£¨Ò»£©DLLÏîÄ¿µÄ½¨Á¢
library mydll;
 
uses
base in 'base.pas';
 
exports
Triple name 'Tr';
 
{$R *.res}
 
begin
end.
 
£¨¶þ£©º¯Êýµ¥Ôª
unit base;
 
interface
 
uses windows;
 
function Triple(N:integer):integer;stdcall;
  ......

delphi±£´æ¶ÁÈ¡utf 8µÄÎı¾Îļþ

delphi±£´æ¶ÁÈ¡utf-8µÄÎı¾Îļþ
¸ø¿Í»§×öÁËÒ»¸öÅúÁ¿Ê¶±ðͼÏñ²¢ºÏ³ÉË«²ãpdfµÄ³ÌÐò£¬×îºó¿Í»§ÐèÒªÉú³ÉµÄͬʱ¸½´øÒ»·Ý¼Çʱ¾Îļþ£¬¾ÍÊÇOCR¹ýºóµÄÎı¾£¬²¢Ö¸¶¨utf-8¸ñʽµÄ¡£ÔÚ´¦Àíutf-8ʱ³öÏÖÁ˵ãСÎÊÌ⣬ÏÖÔÚ×ܽáÈçÏÂ
Ê×ÏÈ ÀûÓÃdelphi×Ô´øµÄUTF8Encodeº¯Êý£¬½«ÆÕͨ×Ö·ûת»»Îªutf-8±àÂë
´´½¨Ò»¸öÁ÷£¬MemoryStream»òFileStr ......

¹ØÓÚ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¡·(¸Ãµç×ÓÊé¿ÉÔÚÍøÉÏÃâ·Ñ»ñµÃ)¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ