INDODELPHI

Blog’s Tutorial Delphi – Reference from Onez Delphi Explorer

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;

November 6, 2007 Posted by Musriah | Application - Task | | No Comments Yet

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;

October 28, 2007 Posted by maulaku | Application - Task | | No Comments Yet