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

ÈçºÎÈÃDelphiµ÷ÓÃÍⲿ³ÌÐò²¢µÈ´ýÆäÔËÐÐÐÅÏ¢£¨Èç½áÊø£©

º¯ÊýÒ»£º
view plaincopy to clipboardprint?
uses 
    Windows,  
    SysUtils,  
    Classes,  
    ShellAPI;  
function RunAndWait(FileName: string; Visibility: Integer): THandle;  
var 
    zAppName: array[0..512] of Char;  
    zCurDir: array[0..255] of Char;  
    WorkDir: string;  
    StartupInfo: TStartupInfo;  
    ProcessInfo: TProcessInformation;  
begin 
    try 
      StrPCopy(zAppName, FileName);  
      GetDir(0, WorkDir);  
      StrPCopy(zCurDir, WorkDir);  
      FillChar(StartupInfo, SizeOf(StartupInfo), #0);  
      StartupInfo.cb := SizeOf(StartupInfo);  
      StartupInfo.dwFlags := STARTF_USESHOWWINDOW;  
      StartupInfo.wShowWindow := Visibility;  
      if not CreateProcess(nil, zAppName, nil, nil, false, Create_NEW_CONSOLE or NORMAL_PRIORITY_CLASS, nil, nil, StartupInfo, ProcessInfo) then 
      begin 
        result := 0;  
        Exit;  
      end 
      else 
      begin 
        WaitForSingleObject(ProcessInfo.hProcess, INFINITE);  
        GetExitCodeProcess(ProcessInfo.hProcess, result);  
      end;  
 


Ïà¹ØÎĵµ£º

DelphiÖÐʵÏÖÎļþ¿½±´µÄÈýÖÖ·½·¨

DelphiÖÐʵÏÖÎļþ¿½±´µÄÈýÖÖ·½·¨
1£®µ÷ÓÃAPIº¯Êý
procedure CopyFile(fromFileName,ToFileName:string);
var
f1,f2:file;
Begin
AssignFile(f1,fromFileName); file://Ö¸¶¨Ô´ÎļþÃû
AssignFile(f2,ToFileName); file://Ö¸¶¨Ä¿±êÎļþÃû
Reset(f1);
Try
Rewrite(f2);
Try
If Lzcopy(TfileRec(f1).handle,TfileRe ......

ÓÃdelphiÖÆ×÷OCX¿âÎļþ£¨Ò»£©

¿ª·¢²½Ö裺
1¡¢´´½¨ActiveX Library¹¤³Ì¡£
2¡¢´´½¨COM Object¡£
3¡¢´´½¨Type Library£¬²¢´´½¨ÏàÓ¦½Ó¿Ú¡£
4¡¢´´½¨½Ó¿Ú¶ÔÓ¦µÄº¯ÊýºÍʵÏÖ¡£
¾ßÌåÈçÏ£º
1¡¢´´½¨ActiveX Library¹¤³Ì¡£
new|other|activeX|activeX library
Delphi»á×Ô¶¯Éú³É¿ò¼Ü´úÂ룬ֱ½Ó±àÒëµÄ»°¾Í¿ÉÒԵõ½Ò»¸ödllÎļþÁË£»
Èç¹ûÏë±àÒë³öÀ´µÄÊÇocxÎÄ ......

ÓÃdelphiÖÆ×÷OCX¿âÎļþ£¨¶þ£©

¿ª·¢²½Ö裺
1¡¢´´½¨ActiveX Library¹¤³Ì¡£
2¡¢´´½¨COM Object¡£
3¡¢´´½¨Type Library£¬²¢´´½¨ÏàÓ¦½Ó¿Ú¡£
4¡¢´´½¨½Ó¿Ú¶ÔÓ¦µÄº¯ÊýºÍʵÏÖ¡£
¾ßÌåÈçÏ£º
1¡¢´´½¨COM Object¡£
new|other|activeX|com object
ÔÚClass Name(±¾ÀýÀïÀàÃûÀïÌîObject£¬¿É°´×Ô¼ºÐèÒªÌîд) ÌîдÀàÃû.(Instancing:ʵÀý´´½¨·½Ê½,Threading Model:Ï ......

×Ö·û´®¡¢PCharÓë×Ö·ûÊý×éÖ®¼äµÄת»»(delphi)

ÉèÓÐÒÔÏÂÈý¸ö±äÁ¿£º
var
  s:string;
  p:pchar;
  a:array[1..20] of char;
ÄÇôÈýÕßÖ®¼äµÄת»»ÈçÏ£º
1¡¢×Ö·û´®µ½PChar
    p:=PChar(s);
2¡¢PCharµ½×Ö·û´®
    s:=p;
3¡¢PCharµ½×Ö·ûÊý×é
    StrCopy(@a,p);
4¡¢×Ö·ûÊý×éµ½PChar
   ......

DelphiÖе÷ÓÃWindows×Ô´øµÄͼƬºÍ´«Õæä¯ÀÀÆ÷

DelphiÖе÷ÓÃWindows×Ô´øµÄͼƬºÍ´«Õæä¯ÀÀÆ÷²é¿´Í¼Æ¬£¬¿ÉÒÔÐýתͼƬҲ¿ÉÒÔµ÷Óû­Í¼³ÌÐò±à¼­Í¼Ïñ¡£×Ô¼ºÐ´²»³öÀ´ºÃµÄ´úÂ룬¾ÍÓÃϵͳ×Ô´øµÄºÃÁË¡£
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,ShellAPI;
type
TForm1 = class(TFo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ