可能方法很多,在这里请教各位大侠的方法是什末?谢谢。
解决方案 »
- 怎样把bimap转换成Variant?
- 学过VB的朋友请进来!!
- 难题《滚动截图》技术,寻求高手解答!谢谢!
- 插入记录引发的异常?
- 各位大虾,如何在ToolBar上面实现DBNavigator,并且DBNavigator的图标可以改动,在线。。
- 求教:delphi7 里有serversocket 吗? 马上给分!!! 不够再加!
- 简单问题
- 我做了一个三层结构的软件,为什么客户端总提示RPC服务器无效! 我用的是DCOM方式!
- 请问如何得到当点击树型控件的小加号时,而得到小加号旁边的结点?
- Help!Help!已知一个窗口的句柄HWND,如何强制关闭它?
- df7中怎么没有QUICKREPORT????相关的打印报表的控件在那里?
- 【JAVA视频教学】 部分下载 ★★★
CreateMutex(nil, True, 'Pro');
if GetLastError = ERROR_ALREADY_EXISTS then
begin
MessageBox(0, '程序已经在运行中......', '提醒' ,MB_ICONINFORMATION);
Halt;
end;
Application.Initialize;
……
Mutex: THandle;
begin
Mutex := CreateMutex(nil, True, 'TradeGate');
if GetLastError <> ERROR_ALREADY_EXISTS then
begin
Application.Initialize;
Application.Title := 'TradeGate';
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TFormWriteOff, FormWriteOff);
Application.Run;
ReleaseMutex(Mutex);
end;
CloseHandle(Mutex);
end.
procedure TForm1.FormCreate(Sender: TObject);
var
zappname:array[0..127] of char;
hold:string;
found:hwnd;
begin
hold:=application.Title;
application.Title:='test';
strpcopy(zappname,hold);
found:=findwindow(nil,zappname);
application.Title:=hold;
if found<>0 then
begin
showwindow(found,sw_restore);
application.Terminate;
end;
end;
WinTypes,
WinProcs,
Messages,
Classes,
Graphics,
Controls,
Dialogs,
Forms,
Unit1 in 'Unit1.pas' {Form1};{$R *.res}
function kk:boolean;
var h1,h2:hwnd;
const
a1:array[0..12] of char ='TApplication'#0;
t1:array[0..9] of char ='Project1'#0;
A2:array[0..6] of char ='TForm1'#0;
t2:array[0..5] of char ='Form1'#0;
begin
H1:=FindWindow(A1, T1);
H2:=FindWindow(A2, T2);
// h2:=FindWindow(nil,'project1'); Result:=(H1 <> 0)and (H2<>0);
end;begin
if kk then
begin
MessageDlg('该程序已经在内存中,你不必再运行!',mtInformation,[mbOk],0);
Halt;
end;
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.
ok了~~