rundll32 shell32.dll,ShellAboutA 他妈的,不是这个。看看上面的“关于MZ”就知道了。rundll32 shell32.dll,ShellAboutA 不过,我觉得和这个类似。rundll32 shell32.dll,ShellAboutA 第一个回答正确的,给100分,谢谢大家。
解决方案 »
- SVN问题
- 关于DELPHI7的问题
- 我下载了用于开发Direct程序的JEDI,但不知道怎么用?请问如何搭建开发环境
- 如何实现使用excle导入sqlserver的实现
- 怎样才可以 在 delphi 的 三层结构中进行数据库的 动态连接?有什么方法吗?怎么使用ini 文件?请教高手!在线等待
- 急,如何在Delphi中获得Access表的真实信息?300分寻求整体解决方案!
- 请教:为什么按钮也消失了!
- 各位高手,问一个关于电子 秤的问题?
- [脚本/接口/Delphi] 谁能提供在Delphi中使用脚本或脚本组件所需要的接口?
- 100分求Formula one的分组和预览解决办法,请高手相助!
- 含dbexpress的数据库程序的安装问题?
- 能我一解决这个问题吗 急!!!!!!!!!!!!谢谢
function ShellAbout; external shell32 name 'ShellAboutA';
哥们帮忙看看吧。今天太晚了。该回去了。好累呀。
//Show ABOUT Box
//549@23:10 2003-8-11
begin
ShellAbout( GetActiveWindow, PChar( Title ), PChar( Caption ), Application.Icon.Handle);
end;
//If the text contains a "#" separator, dividing it into two parts, the function displays the first part in the title bar, and the second part on the first line after the text "Microsoft Windows" or "Microsoft Windows NT."
//Just call it like this :WinAbout('Title1#Title2','other');//Write '关于' yourself
//And this :WinAbout('Title','other');//Windows Write '关于' for you
******************
rundll32 shell32.dll,ShellAboutW 不是的,这个用宽字符。所以你看到的是乱码。
学习ing.
我的操作系统:win2k Server. 不知道其它的操作系统是否有区别。
ShellAbout(self.Handle,'My App','',MB_ICONWARNING);
ShellAboutw(self.Handle,'我的应用程序','',MB_ICONWARNING);
我知道,已经封装了。有时间发给你。我现在不在公司。to: fengjn(小枫)
愿闻其详。
1.在命令行下输入命令,得到
ShellAbout(Handle, '关于记事本', '你要什么呀', hinstance);
这样的效果,当然,我不奢望实现hinstance这个ticon参数。2.shellabout是如何与shellabouta或者shellaboutw进行通讯的。大概是我表述不清,大家原谅。
function ShellAboutA; external shell32 name 'ShellAboutA';//给那些熟悉api的人
function ShellAboutW; external shell32 name 'ShellAboutW';
至于我说记事本是使用ShellAboutW的根据已经发到你的信箱中了,是一个图片,没办法贴出来。
//*****************************************
1.在命令行下输入命令,得到
ShellAbout(Handle, '关于记事本', '你要什么呀', hinstance);
这样的效果,当然,我不奢望实现hinstance这个ticon参数。在DOS下输入unicode似乎不行,也许是我理解有问题这个ShellAboutW理解有问题我认为这个是unicode的理由如下:
function ShellAboutW(Wnd: HWND; szApp, szOtherStuff: PWideChar; Icon: HICON): Integer; stdcall;2.shellabout是如何与shellabouta或者shellaboutw进行通讯的。
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Menus;type
TForm1 = class(TForm)
MainMenu1: TMainMenu;
a1: TMenuItem;
miNewChild: TMenuItem;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure miNewChildClick(Sender: TObject);
private
FPrevWndProc, FNewWndProc: TFarProc;
procedure ClientWndProc(var Message: TMessage);
public
{ Public declarations }
end;var
Form1: TForm1;implementationuses Unit2;{$R *.dfm}procedure TForm1.ClientWndProc(var Message: TMessage);
begin
with Message do
begin
case Msg of
WM_NCACTIVATE,
WM_NCCALCSIZE:
SetWindowLong(ClientHandle, GWL_EXSTYLE, GetWindowLong(ClientHandle, GWL_EXSTYLE) and not WS_EX_CLIENTEDGE);
end;
Result := CallWindowProc(FPrevWndProc, ClientHandle, Msg, WParam, LParam);
end;
end;procedure TForm1.FormCreate(Sender: TObject);
begin
if ClientHandle <> 0 then
begin
FNewWndProc := MakeObjectInstance(ClientWndProc);
FPrevWndProc := Pointer(GetWindowLong(ClientHandle, GWL_WNDPROC));
SetWindowLong(ClientHandle, GWL_WNDPROC, Integer(FNewWndProc));
end;
end;procedure TForm1.FormDestroy(Sender: TObject);
begin
if ClientHandle <> 0 then
begin
SetWindowLong(ClientHandle, GWL_WNDPROC, Integer(FPrevWndProc));
FreeObjectInstance(FNewWndProc);
end;
end;procedure TForm1.miNewChildClick(Sender: TObject);
begin
with TForm2.Create(Application) do Show;
end;end.
--------------------------------------------------------------------------------
unit Unit2;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs;type
TForm2 = class(TForm)
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;{var
Form2: TForm2;}implementation{$R *.dfm}procedure TForm2.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;end.
function ShellAbout(Wnd: HWND; szApp, szOtherStuff: PChar; Icon: HICON): Integer; stdcall;
{$EXTERNALSYM ShellAboutA}
function ShellAboutA(Wnd: HWND; szApp, szOtherStuff: PAnsiChar; Icon: HICON): Integer; stdcall;
{$EXTERNALSYM ShellAboutW}
function ShellAboutW(Wnd: HWND; szApp, szOtherStuff: PWideChar; Icon: HICON): Integer; stdcall;function ShellAbout; external shell32 name 'ShellAboutA';
function ShellAboutA; external shell32 name 'ShellAboutA';
function ShellAboutW; external shell32 name 'ShellAboutW';
ShellAbout和ShellAboutA是一样的。
pw : PWideChar;
begin
pw := AllocMem( 255 );
StringToWideChar( '随便写点什么', pw, 255);
ShellAboutW( GetActiveWindow, pw, pw, 0);
FreeMem( pw );
end;
//我明白了第二个问题,第一个问题似乎不应该在这里问。
//散分吧,到别的版问问。
感谢weion(wei)
***************************8
我来证明一下用命令行不能实现:
我使用2003 SERVER,我用EXESCOPE查看了SHELL32的资源,很明显,ShellAboutA调用了一个对话框资源,ID为14352,现在的问题就是在命令行方式下能不能把要表达的参数传达给ShellAboutA(顺便说一下,NOTEPAD调用的应该是ShellAboutW),答案是不能。
原因在于:
楼上几位仁兄已经深入剖析了该函数的工作原理,但显然RUNDLL32不能处理传入的多个参数,特别是字符串参数,因为要区别多个字符串参数,需要在字符串末尾加入/0,RUNDLL32没有做这样的处理,在命令行方式下也不可能输入/0。
由于参数传递一般都使用堆栈,这样输入的参数就改变了用户的声明部分,而之所以出现MZ,熟悉汇编的想一下就清楚了,内存块的头部标志就是这两个字母,这里已经发生了内存溢出现象.这是W2K一个安全漏洞,2003似乎已经改进了。原帖:http://expert.csdn.net/Expert/topic/2140/2140703.xml?temp=.3685877