var
h : HWND;
ret : integer;
begin
//office_title:指office的标题
h := CreateMutex(nil, false, office_title);
Ret:=GetLastError;
If Ret=ERROR_ALREADY_EXISTS Then
Begin
ShowMessage('已经运行!');
ReleaseMutex(hMutex);
Exit;
End
else
//启动office
h : HWND;
ret : integer;
begin
//office_title:指office的标题
h := CreateMutex(nil, false, office_title);
Ret:=GetLastError;
If Ret=ERROR_ALREADY_EXISTS Then
Begin
ShowMessage('已经运行!');
ReleaseMutex(hMutex);
Exit;
End
else
//启动office
解决方案 »
- 求解:SQL字段设定numeric(18,6),但是在前台查询结果默认只有4位小数。为什么?
- 数据程序程序移到别的电脑上的问题
- 用regsvr32 注册dll文件时出错误,LoadLibrary("c:\windows\system32\11.dll")失败-找不到指定的模块。
- delphi7写的类型为wad的webservice,如何在IIS中发布?~~~~~~~~~~~~~~~~~~~~~~~~~~~
- SSL 在Delphi 7中如何使用??那位有相关的实例?
- 几天没来咋又改版了?
- 各位高手请指教:如何打包成EXE文件?
- 请教各位大虾,取本机的机器码是用什么函数啊?
- delphi7中是不是没有qreport组件啊
- 用那个函数确定一个字符串的字节长度(急)
- 開發一個二層的C/S多用戶系統是不是一定要用到TDATABASE,OR TADOCONNECTION,現沒分,下次給,多謝
- 在DELPHI6里有TNMPOP3构件吗?如有,它在哪里?送分!!!
ReleaseMutex(h);
procedure TForm1.Button1Click(Sender: TObject);
var ls:hwnd;
begin
ls:=findwindow(nil,'microsoft access');
sendmessage(ls,wm_syscommand,sc_close,0);end;
begin
d:=findwindow(nil,'microsoft excel');
if d<>0 then
sendmessage(ls,wm_close,0,0)
else
application.messagebox('aaa','ddd',mb_iconinformation+mb_ok);end;