有请高手......
if CheckInstance('PURCHASE') then
Begin
…….
End;
-------------------------------------------------------------------------------
function CheckInstance(sApp : string) : boolean;
begin
UniqueAppStr := PChar(sApp);
MessageID := RegisterWindowMessage(UniqueAppStr);
if InitInstance then result := true
else result := false;
end;
-------------------------------------------------------------------------------
function InitInstance: boolean;
begin
MutHandle := OpenMutex(MUTEX_ALL_ACCESS,False,UniqueAppStr);
if MutHandle = 0 then begin
DoFirstInstance;
result := true;
end
else begin
BroadcastFocusMessage;
result := false;
end
end;
-------------------------------------------------------------------------------
procedure DoFirstInstance;
begin
SubClassApplication;
MutHandle := CreateMutex(Nil, False, UniqueAppStr);
if MutHandle = 0 then
MIError := MIError or MI_FAIL_CREATE_MUTEX;
end;
-------------------------------------------------------------------------------
procedure SubClassApplication;
begin
WPRoc := TFNWndProc(SetWindowLong(Application.Handle, GWL_WNDPROC, Longint(@NewWndProc)));
if WProc = Nil then MIError := MIError or MI_FAIL_SUBCLASS;
end;
-------------------------------------------------------------------------------
1.函数 CheckInstance('PURCHASE') 在此处的作用?
2.RegisterWindowMessage(UniqueAppStr); 有没有写到注册表中?
3. TFNWndProc(SetWindowLong(Appli…(@NewWndProc)))
TFNWndProc 是什么?(是不是强制类型转化,如是那是什么类型?)
4.OpenMutex(MUTEX_ALL_ACCESS,False,UniqueAppStr); 和
CreateMutex(Nil, False, UniqueAppStr);中 ,
提到互斥体对象, 怎样理解?
相关推荐
MK检验程序出错有请大侠-MK.m
MK检验程序出错有请大侠-MK.m % Time Series Trend Detection Tests % % [ z, sl, lcl, ucl ] = trend % % where z = Mann-Kendall Statistic % sl = Sen's Slope Estimate % lcl = Lower Confidence Limit of sl % ucl = Upper Confidence Limit of sl % y = Time Series of Data % dt = Time Interval of Data % % Bob Newell, February 1996 % %-------------------------------------------------- % load unnamed1.mat; y=unnamed1; function [ z, sl, lcl, ucl ] = trendMK % n = length; %-------------------------------------------------- % Mann-Kendall Test for N > 40 % disp; if n < 41, disp; end; % calculate statistic s = 0; for k = 1:n-1, for j = k 1:n, s = s sign - y ); end; end; % variance v = * ) / 18; % test statistic if s == 0, z = 0; elseif s > 0, z = / sqrt; else z = / sqrt; end; % should calculate Normal value here nor = 1.96; % results disp ] ); disp ) ] ); disp ] ); if abs < nor, disp; z = 0; elseif z > 0, disp; else disp; end; %---------------------------------------------------- % disp; % calculate slopes ndash = n * / 2; s = zeros; i = 1; for k = 1:n-1, for j = k 1:n, s = - y ) / / dt; i = i 1; end; end; % the estimate sl = median; disp ] ); % variance v = * ) / 18; m1 = fix ) / 2 ); m2 = fix ) / 2 ); s = sort; lcl = s; ucl = s; disp( [ ' Lower Confidence Limit = ' ... num2str ] ); disp( [ ' Upper Confidence Limit = ' ... num2str ] ); %---------------------------------------------------- % the end
这应该是最好的网易云音乐播放器了,没有之一,如果有请打醒.zip
这应该是最好的网易云音乐播放器了,没有之一,如果有请打醒.zip,网易云音乐第三方
数字万用表应用技巧双变压器做逆变器有请
数字万用表应用技巧数字万用表应用技巧数字万用表应用技巧数字万用表应用技巧数字万用表应用技巧
网络靶场的靶子——网络蓝军
网络靶场的标的物,红军的目标靶子。有请网络牛人小试牛刀,闯关有奖!
DEV-C++小游戏-狼人杀(完整版)
这个游戏是以前编了三天的,各种职业都有,玩法多样,和网页上的差不多,最近突然找到发现程序可以正常运行且本人亲测过游戏目前无bug,若有请提出,将不断改进,感谢支持~


Windows SDK/API
