본문 바로가기

분류 전체보기844

[Delphi] 최상위 윈도우가 전체화면인지 확인하기 function IsMaxWindow: boolean; var Hnd: HWND; Rect: TRect; begin Result := False; Hnd := GetForegroundWindow(); // 현재 작업중인 윈도우를 알아내는 함수 GetWindowRect(Hnd, Rect); if (Rect.Left Rect.Top) then exit; if (Rect.Right = Screen.Width) and (Rect.Bottom = Screen.Height) then Result := True; // 전체화면 end; 2011. 5. 16.
[Delphi] 폼 드래그해서 이동하기 MouseDown 이벤트에서 ReleaseCapture; SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0); 2011. 5. 16.
[Delphi] 하위 폴더까지 한번에 생성하기 uses SysUtils; function ForceDirectories(Dir: string): Boolean; 이런 좋은 함수를 이제야 알다니.. 2011. 5. 16.
[Delphi] 웹페이지 로딩 완료 체크하기 브라우저 컴포넌트의 DocumentComplete 이벤트에서 확인 가능함 !! procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant); var CurWebrowser: IWebBrowser; TopWebBrowser: IWebBrowser; Document: OleVariant; WindowName: string; begin CurWebrowser := pDisp as IWebBrowser; TopWebBrowser := (Sender as TWebBrowser).DefaultInterface; if CurWebrowser = TopWebBrowser then ShowM.. 2011. 4. 7.
[Delphi] 전화번호 형식으로 바꾸기 function TelNoAutoMata(vTelNo: string): string; var tTelNo: string; FLocal, FSeoul: Boolean; begin tTelNo := StringReplace(vTelNo, '-', '', [rfReplaceAll, rfIgnoreCase]); if (Length(tTelNo) 12) then begin // Edit MaxLength : 13 result := copy(vTelNo, 1, 13); exit; end; FLocal := False; FSeoul := False; if tTelNo[1] = '0' then FLocal := True; if (FLocal) and (tTelNo[2] = '2') then FSeoul := True;.. 2011. 4. 5.
[Delphi] 문자 사이에서 숫자 추출 / 숫자 사이에서 문자 추출 { 문자 사이에서 숫자 추출하기 } function ExtractInt(AString: string): string; var I: Integer; TempString: string; begin TempString := ''; AString := Trim(AString); if AString '' then for I := 1 to Length(AString) do if (AString[I] in ['0'..'9']) then TempString := TempString + AString[I]; Result := Trim(TempString); end; { 숫자 사이에서 문자 추출하기 } function ExtractString(AString: string): string; var I: Integer; Te.. 2011. 4. 5.
[Delphi] 바탕화면 강제 새로고침 procedure UpdateDesktop; var hDesktop: HWND; begin hDesktop := FindWindowEx(FindWindowEx (FindWindow('Progman', 'Program Manager'), 0, 'SHELLDLL_DefView', nil), 0, 'SysListView32', nil); PostMessage(hDesktop, WM_KEYDOWN, VK_F5, 0); PostMessage(hDesktop, WM_KEYUP, VK_F5, 1 shl 31); end; 단점)) 새로고침 되면서 깜빡임!! 2011. 4. 5.
[Delphi] 문자수, 바이트수 문자수 ByteToCharLen(str, Length(str)) 바이트수 Length(str) 2011. 4. 5.
[Delphi] URL에서 파일이름 추출하기 ExtractFileName(StringReplace(url, '/', '\', [rfReplaceAll])); 2011. 4. 5.
[Delphi] uJSON 라이브러리 ex) JSONObject.getJSONObject('test').getJSONArray('list').getJSONObject(0).keys.Strings[0] JSONObject.getJSONObject('test').getJSONArray('list').getJSONObject(I).get('name').toString =========================================================================================== procedure TForm1.Test; var JSONObject: TJSONObject; begin JSONObject := TJSONObject.create('json데이타내용'); for i := 0 to JSON.. 2011. 4. 5.