IS THE TASKBAR ALLWAYS ON TOP?
// ******************************************************************
// IS THE TASKBAR ALLWAYS ON TOP?
// Category : Task
// Author : ZieglerSoft
// Author Email :
// Author Web : http://www.zieglersoft.dk/includes/usercount.asp
// Tips Website : DelphiTips.com
// Tips Website URL: http://www.delphitips.com
// ******************************************************************
Uses
ShellApi;
Function IsTaksBarAllwaysOnTop:Boolean;
Var
AB : TAppBarData;
Begin
AB.cbSize := sizeof(AB);
Result :=(SHAppBarMessage(ABM_GETSTATE, AB)and ABS_ALWAYSONTOP) > 0;
End;
EXECUTE A PROGRAM AND HAVE MY CODE WAIT UNTIL IT IS FINISHED
// ******************************************************************
// EXECUTE A PROGRAM AND HAVE MY CODE WAIT UNTIL IT IS FINISHED
// Category : Task
// Author : Gustav Evertsson
// Author Email :
// Author Web :
// Tips Website : DelphiTips.com
// Tips Website URL: http://www.delphitips.com
// ******************************************************************
uses Wintypes,WinProcs,Toolhelp,Classes,Forms;
Function WinExecAndWait(Path : string; Visibility : word) : word;
var
InstanceID : THandle;
PathLen : integer;
begin
// inplace conversion of a String to a PChar
PathLen := Length(Path);
Move(Path[1],Path[0],PathLen);
Path[PathLen] := #0;
// Try to run the application
InstanceID := WinExec(@Path,Visibility);
if InstanceID < 32 then // a value less than 32 indicates an Exec error
WinExecAndWait := InstanceID
else
begin
Repeat
Application.ProcessMessages;
until Application.Terminated or (GetModuleUsage(InstanceID) = 0);
WinExecAndWait := 32;
end;
end;
-
Archives
- November 2007 (8)
- October 2007 (32)
-
Categories
-
RSS
Entries RSS
Comments RSS