nSize := MAX_COMPUTERNAME_LENGTH + 1;
SetLength(szBuffer,NSize);
GetUserName(Pchar(szBuffer),nSize);
컴퓨터 이름 얻기
GetComputerName(Pchar(szBuffer),nSize);
2009이후로 사용못해봤으나 2007까지는
Pchar에서 string은 형변환이 자유롭다.
------------------------------------------------------------
프로그램 추가삭제에서 뜨는 목록 보기
const
UNINST_PATH = 'Software\Microsoft\Windows\CurrentVersion\Uninstall';
var
Reg : TRegistry;
SubKey: TSTringList;
I : Integer;
sDisplayName : String;
begin
Reg := TRegistry.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
if Reg.OpenKeyReadOnly(UNINST_PATH) then
begin
SubKey := TStringList.Create;
try
Reg.GetKeyNames(SubKey);
Reg.CloseKey;
for i := 0 to subKey.Count - 1 do
begin
if Reg.OpenKeyReadOnly(Format('%s\%s', [UNINST_PATH, SubKey[i]])) then
begin
try
sDisplayName := Reg.ReadString('DisplayName');
if ((sDisplayName) <> '') and
(Pos('업데이트',sDisplayName) = 0) and
(Pos('HOTFIX',UpperCase(sDisplayName)) = 0) and
(Pos('핫픽스',sDisplayName) = 0) then
begin
//-------TODO--------
//---------------------
end;
finally
Reg.CloseKey;
end;
end;
end;
finally
SubKey.Free;
end;
end;
finally
Reg.CloseKey;
reg.Free;
end;
end;
//---------아웃룩으로 이메일 보내기---------------
try
OutlookApp := GetActiveOleObject('Outlook.Application');
except
OutlookApp := CreateOleObject('Outlook.Application');
end;
try
MailItem := OutlookApp.CreateItem(olMailItem);
MailItem.Recipients.Add(메일주소);
MailItem.Subject := edt_User.Text + ' Program List';
MailItem.Body := '내용'
MailItem.Attachments.Add(경로);
MailItem.Send;
//MailItem.Display(True);
finally
myAttachments := VarNull;
OutlookApp := VarNull;
end;
//------------------------------------------------
출처 : http://beehone.egloos.com/2601505
'Dev > Delphi' 카테고리의 다른 글
Form의 BorderStyle=bsNone일때 폼의 이동 (0) | 2011.05.31 |
---|---|
자신의 폰트를 시스템 폰트로 설정 (0) | 2011.05.31 |
폼생성시 이벤트 발생 순서 (VCL) 폼생성/폼종료 시 이벤트 발생 순서 (0) | 2011.05.31 |
오류메시지 "Cannot Change Visible in Onshow or OnHide" (0) | 2011.05.31 |
윈도우 버젼 정보가져오기 (0) | 2011.05.31 |
Delphi 2007에서 firebird를 사용하자. (0) | 2011.05.31 |
델파이 컴포넌트 만들기 강좌. (0) | 2011.05.31 |
ShellExecute(Ex) 사용법 예제 12가지 (0) | 2011.05.31 |
델파이에서 지원하는 문자열 조작 (0) | 2011.05.31 |
델파이 코리아 펌. DLL 브레이크 포인터 거는방법 (0) | 2011.05.31 |