Fórum O que colocar no menu quot;SOBREquot; do sistema #368838
05/03/2009
0
Tenho um menu ´SOBRE´ no sistema, mas por enquanto ele só tem:
- Logo e site da empresa
- Logo do produto
Queria algumas funções sobre espaço em disco, memória, localização do banco de dados, usuários conectados, etc ... Quero dicas do que colocar nesse menu...
Valeu !
Powerlog Tecnologia
Curtir tópico
+ 0Posts
21/03/2009
Otto
tipo, adiciona um memo no seu form, ai no create do form voce coloca:
const cBytesPorMb = 1024 * 1024; var M: TMemoryStatus; begin M.dwLength := SizeOf(M); GlobalMemoryStatus(M); Memo1.Clear; with Memo1.Lines do begin Add(Format(´Memória em uso: ¬d¬¬´, [M.dwMemoryLoad])); Add(Format(´Total de memória física: ¬f MB´, [M.dwTotalPhys / cBytesPorMb])); Add(Format(´Memória física disponível: ¬f MB´, [M.dwAvailPhys / cBytesPorMb])); Add(Format(´Tamanho máximo do arquivo de paginação: ¬f MB´, [M.dwTotalPageFile / cBytesPorMb])); Add(Format(´Disponível no arquivo de paginação: ¬f MB´, [M.dwAvailPageFile / cBytesPorMb])); Add(Format(´Total de memória virtual: ¬f MB´, [M.dwTotalVirtual / cBytesPorMb])); Add(Format(´Memória virtual disponível: ¬f MB´, [M.dwAvailVirtual / cBytesPorMb])); end;
a localização do banco voce pode pegar atraves do Conector que esteja usando ;)
espero que ajude, abraço.
Gostei + 0
23/03/2009
Powerlog Tecnologia
Já deu para melhorar um pouco a tela, que estava muito simples.
Eu uso FB. O path do banco peguei da conexão mesmo e a quantidade de usuários conectados eu peguei do IBInfo.
Valeu :!:
Gostei + 0
23/03/2009
Otto
Gostei + 0
23/03/2009
Bacalhau
Está aqui o código que depois podes ajustar ao teu caso
cumprimentos
unit About;
interface
uses Windows, Classes, Graphics, Forms, Controls, StdCtrls, SysUtils,
Buttons, ExtCtrls, jpeg, dialogs;
type
TAboutBox = class(TForm)
OKButton: TButton;
Image1: TImage;
Label2: TLabel;
Label1: TLabel;
Label3: TLabel;
Label4: TLabel;
Memo1: TMemo;
Label5: TLabel;
Label6: TLabel;
Memo2: TMemo;
procedure CarregaBMP(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
AboutBox: TAboutBox;
implementation
{$R *.DFM}
function versao(const FileName: string; var FileInfo: TStringList): Boolean;
const
Key: array[1..9] of string =(´CompanyName´,
´FileDescription´,
´FileVersion´,
´InternalName´,
´LegalCopyright´,
´OriginalFilename´,
´ProductName´,
´ProductVersion´,
´Comments´);
KeyBr: array [1..9] of string = (´Empresa´,
´Descricão´,
´Versão do ficheiro´,
´Nome interno´,
´Copyright´,
´Nome original do ficheiro´,
´Produto´,
´Versão do produto´,
´Comentários´);
var
Dummy : THandle;
BufferSize, Len : Integer;
Buffer : PChar;
LoCharSet, HiCharSet : Word;
Translate, Return : Pointer;
StrFileInfo, Flags : string;
TargetOS, TypeArq : string;
FixedFileInfo : Pointer;
i : Byte;
begin
Result := False;
{ Obtemos o tamanho em bytes do ´version information´ }
BufferSize := GetFileVersionInfoSize(PChar(FileName), Dummy);
if BufferSize <> 0 then
begin
GetMem(Buffer, Succ(BufferSize));
try
if GetFileVersionInfo(PChar(FileName), 0, BufferSize,Buffer) then
// Executamos a função ´VerQueryValue´ e conseguimos informações sobre
// o idioma /character-set
if VerQueryValue(Buffer, ´\VarFileInfo\Translation´, Translate, UINT(Len)) then
begin
LoCharSet := LoWord(Longint(Translate^));
HiCharSet := HiWord(Longint(Translate^));
for i := 1 to 9 do
begin
{ Montamos a string de pesquisa }
StrFileInfo := Format(´\StringFileInfo\0¬x0¬x\¬s´, [LoCharSet, HiCharSet, Key[i]]);
{ Adicionamos cada key pré-definido }
if VerQueryValue(Buffer,PChar(StrFileInfo), Return, UINT(Len))
then FileInfo.Add(KeyBr[i] + ´: ´ + PChar(Return));
end;
if VerQueryValue(Buffer,´\´,FixedFileInfo, UINT(Len)) then
with TVSFixedFileInfo(FixedFileInfo^) do
begin
Flags := ´´;
{Efetuamos um bitmask e obtemos os ´flags´ do arquivo}
if (dwFileFlags and VS_FF_DEBUG) = VS_FF_DEBUG
then Flags := Concat(Flags,´*Debug* ´);
if (dwFileFlags and VS_FF_SPECIALBUILD) = VS_FF_SPECIALBUILD
then Flags := Concat(Flags, ´*Special Build* ´);
if (dwFileFlags and VS_FF_PRIVATEBUILD) = VS_FF_PRIVATEBUILD
then Flags := Concat(Flags, ´*Private Build* ´);
if (dwFileFlags and VS_FF_PRERELEASE) = VS_FF_PRERELEASE
then Flags := Concat(Flags, ´*Pre-Release Build* ´);
if (dwFileFlags and VS_FF_PATCHED) = VS_FF_PATCHED
then Flags := Concat(Flags, ´*Patched* ´);
if Flags <> ´´ then FileInfo.Add(´Atributos: ´ + Flags);
TargetOS := ´Plataforma: ´;
{ Plataforma }
case dwFileOS of
VOS_UNKNOWN : TargetOS := Concat(TargetOS, ´Desconhecido´);
VOS_DOS : TargetOS := Concat(TargetOS, ´MS-DOS´);
VOS_OS216 : TargetOS := Concat(TargetOS, ´16-bit OS/2´);
VOS_OS232 : TargetOS := Concat(TargetOS, ´32-bit OS/2´);
VOS_NT : TargetOS := Concat(TargetOS, ´Windows NT´);
VOS_NT_WINDOWS32, 4: TargetOS := Concat(TargetOS, ´Windows 32 bits´);
VOS_DOS_WINDOWS16: TargetOS := Concat(TargetOS, ´Windows 16 bits ´, ´sob MS-DOS´);
else
TargetOS := Concat(TargetOS, ´Fora de padrão. Código: ´, IntToStr(dwFileOS));
end;
FileInfo.Add(TargetOS);
TypeArq := ´Tipo de ficheiro: ´;
// Tipo de Arquivo
case dwFileType of
VFT_UNKNOWN : TypeArq := Concat(TypeArq,´Desconhecido´);
VFT_APP : TypeArq := Concat(TypeArq,´Aplicação´);
VFT_DLL : TypeArq := Concat(TypeArq,´DLL´);
VFT_DRV : begin
TypeArq := Concat(TypeArq,´Device driver - Driver ´);
case dwFileSubtype of
VFT2_UNKNOWN : TypeArq := Concat (TypeArq, ´Desconhecido´);
VFT2_DRV_PRINTER : TypeArq := Concat(TypeArq,´de Impressão´);
VFT2_DRV_KEYBOARD : TypeArq := Concat(TypeArq,´de Teclado´);
VFT2_DRV_LANGUAGE : TypeArq := Concat(TypeArq,´de Idioma´);
VFT2_DRV_DISPLAY : TypeArq := Concat(TypeArq,´de Vídeo´);
VFT2_DRV_MOUSE : TypeArq := Concat(TypeArq,´de Mouse´);
VFT2_DRV_NETWORK : TypeArq := Concat(TypeArq,´de Rede´);
VFT2_DRV_SYSTEM : TypeArq := Concat(TypeArq,´de Sistema´);
VFT2_DRV_INSTALLABLE : TypeArq := Concat(TypeArq,´Instalável´);
VFT2_DRV_SOUND : TypeArq := Concat(TypeArq,´Multimédia´);
end;
end;
VFT_FONT : begin
TypeArq := Concat(TypeArq,´Fonte - Fonte ´);
case dwFileSubtype of
VFT2_UNKNOWN : TypeArq := Concat(TypeArq, ´Desconhecida´);
VFT2_FONT_RASTER : TypeArq := Concat(TypeArq,´Raster´);
VFT2_FONT_VECTOR : TypeArq := Concat(TypeArq,´Vectorial´);
VFT2_FONT_TRUETYPE : TypeArq := Concat(TypeArq,´TrueType´);
end; // case
end;
VFT_VXD : TypeArq := Concat(TypeArq,´Virtual device´);
VFT_STATIC_LIB : TypeArq := Concat(TypeArq,´Static-link Lib.´);
end;
FileInfo.Add(TypeArq);
end;
end;
finally
FreeMem(Buffer, Succ(BufferSize));
Result := FileInfo.Text <> ´´;
end;
end;
end;
procedure TAboutBox.CarregaBMP(Sender: TObject);
var StrLst: TStringList;
i : integer;
begin
if FileExists(´splash.JPG´)
then image1.picture.loadfromfile(´splash.jpg´);
StrLst := TStringList.Create;
try
versao(´c:\proj32\standard\gestao2.exe´,StrLst);
Memo1.Lines.Assign(StrLst);
finally
StrLst.Free;
end;
for i := 0 to (memo1.lines.count * 2) - 1 do
begin
if (i mod 2) <> 0 then memo1.lines.Insert(i,´ ´);
end;
memo1.ReadOnly := true;
end;
end.
bacalhau
Gostei + 0
23/03/2009
Powerlog Tecnologia
Gostei + 0
23/03/2009
Saint
no meu about tenho assim:
ocupando todo o lado esquerdo do form, uma figura azul que tem um globo e uns desenhos..eh uma imagem que peguei da internet..
ai na outra parte da tela tenho algo assim:
MinhaEmpresa Nome do software (versao do software)
Este produto está licenciado para:
Razao social do meu cliente
Código de registro: E94623BBB36F0D5CB1706F519XXXXXXXXXXX (chave do usuario)
Product ID: 6C46BF4342B6038E1B31XXXXXXXXXXXX (Codigo da Licenca para o cliente)
ai logo abaixo tenho um texto dizendo que o produto é protegido por lei, etc etc..que nao pode ser copiado, enfim..
enfim, a tela fica muito mais clean e profissional, justamente por conter informacoes realmente relevantes, porque sinceramente nenhum usuario do teu software vai abrir o ´About´ pra ver quanto espaço livre tem na maquina por exemplo...bom, é uma dica
Gostei + 0
23/03/2009
Powerlog Tecnologia
Gostei + 0
23/03/2009
Saint
mas gosto é gosto...foi só uma dica
abraco
Gostei + 0
23/03/2009
Powerlog Tecnologia
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)