1)Load的时候,不要指定路径
2)调用格式有问题fun的定义不对:
int ShellAbout ( HWND hWnd, // handle of parent window
LPCTSTR szApp, // title bar and first line text
LPCTSTR szOtherStuff, // other dialog text
HICON hIcon // icon to display
);
2)调用格式有问题fun的定义不对:
int ShellAbout ( HWND hWnd, // handle of parent window
LPCTSTR szApp, // title bar and first line text
LPCTSTR szOtherStuff, // other dialog text
HICON hIcon // icon to display
);
var fun:function(hwnd:hwnd;str1,str2:pchar;hicon:hicon):dword;
hand1:thandle;
begin
hand1:=loadlibrary('c:\winnt\system32\shell32.dll');
if hand1<>0 then
@fun:=getprocaddress(hand1,'ShellAboutA')
else showmessage('hand=0');
if @fun<>nil then fun(0,'abc','xyz',0)
else showmessage('fun=nil');
end;
现在程序改成如上形式,运行结果是可以显示出对话框来。但是当按了对话框中的确定按钮或结束这个程序时,会有出错提示!“Access violation at address 004357DF in module 'Project2.exe'.Read of address 00000026.”,以上程序应该怎么改?
uses ShellApi;
ShellAbout:顯示一個標准的幫助框
MessageBox:顯示一個系統提示框﹗
shCreatefolder:顯示一個創建目錄的窗體。
SHGetSpecialFolderLocation等等很多都是。
給你推荐一個好的Search網站﹕http://www.google.com,
你將發現更多﹗﹗﹗﹗﹗