본문 바로가기

델파이

델파이 소켓 이벤트 델파이 기본 소켓 (TClientSocket / TServerSocket)에 프록시를 추가하여 커스텀 소켓을 만드는 과정에서 소켓 이벤트 관련하여 찾은 자료중의 일부입니다. TSocketEvent = ( seLookup, seConnecting, seConnect, seDisconnect, seListen, seAccept, seWrite, seRead ); Value Meaning seLookup (Client sockets only) The Windows socket object is about to locate the server socket. Changing the properties of the client socket has no effect at this point, but changes t.. 더보기
CPU 사용량 체크 (Windows 2000, XP, Vista, 7) 기존에 웹에서 떠도는 소스는 Windows7을 정상적으로 지원하지 않더라구요 그래서 32비트에서는 정상적으로 동작하는듯 합니다만, 64비트 OS에서는 ntdll.dll 파일의 콜백 함수 NtQuerySystemInformation를 호출하는 과정에서 SYSTEM_PERFORMANCE_INFORMATION 구조체를 이용해서 CPU Idle time을 가져오는 부분이 정상적으로 동작하지 못해서 체크가 안되는 부분이 발생합니다. 이는 Windows7에서 SYSTEM_PERFORMANCE_INFORMATION 구조체의 구조가 변경되어서라고 MSDN에는 코멘트가 달려 있더군요. 이를 보완하기 위해서 만들어진 코드를 첨부합니다. 이름모를 중국 사이트에서 가져왔습니다...만 저작권에 문제가 있는지는 잘 모르겠네요 중.. 더보기
Delphi 2010 외부 콜백 호출 시 유의 사항 제가 이전까지 쓰던 Delphi7에서는 function RegisterControlChangeNotify(pNotify: IAudioEndpointVolumeCallback): HRESULT stdcall; 와 같이 ; 첨자 하나가 없어도 얼기발기 컴파일이 되어서 넘어갔지만 D2010에서는 아래와 같이 정확히 지켜주어야만 합니다. function RegisterControlChangeNotify(pNotify: IAudioEndpointVolumeCallback): HRESULT; stdcall; 이상 땡! 더보기
Delphi 2010 완벽 제거하기 간혹 델파이를 삭제하고 나면 재설치 하고자 할 때 무언가 때문에 정상적으로 설치되지 않는 경우가 있습니다. 제대로 지워지지 않은 경우에 그럴 수 있는데요. 그럴 땐 이렇게 하시면 됩니다. 1) Delphi 2010 언인스톨. 2) C:\Program Files\Embarcadero\RAD Studio\7.0 디렉토리 제거. Windows 7 / Windows Vista 사용자: 3a) C:\ProgramData\Embarcadero\RAD Studio\7.0 디렉토리 제거. 3b) C:\ProgramData\{AB3EC276... 디렉토리 제거. (설치했던 일자와 같은 날짜의 폴더) 3c) C:\Users\All Users\Embarcadero\RAD Studio\7.0 디렉토리 제거. Windows X.. 더보기
문자열 줄바꿈 하기 간단한 건데 자꾸 잊어버려서 아예 메모를 해두어야 겠습니다 =ㅅ=;; Delphi에서 문자열 줄바꿈은 다른 언어와는 다르게 [#13#10]을 이용합니다. Var sTempString : String; Begin sTempString := 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; Showmessage(sTempString); end; 을 실행하면 출력으로는 이런 메시지 창이 보여집니다. 그런데 여기서 Var sTempString : String; Begin sTempString := 'ABCDEFGHIJKLM' + #13#10 + 'NOPQRSTUVWXYZ'; Showmessage(sTempString); end; 으로 변경하고 실행하면 함수 호출 시에 출력으로 이런 메시지 창이 보여지게 됩니.. 더보기
DragFullWindows 윈도우 효과에서 [마우스로 끄는 동안 창 내용 표시]를 켜고 끌 수 있는 함수 입니다. SPI_SETDRAGFULLWINDOWS 외에 다른 지정된 상수를 이용하면 다른 효과도 컨트롤 할 수 있습니다. function TForm1.ActivateDragFullWindows(Activate: boolean): boolean; var IntActive: byte; begin Result := False; try if Activate then IntActive := 1 else IntActive := 0; Result := SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, IntActive, nil, 0); except end; end; 더보기
How to Uninstall C++ Builder/Delphi 2009 아래 내용은 훅크선장님이 번역하신 내용입니다. Delphi 2009의 언인스톨러 만으로는 깔끔하게 안지워지는데다가 Delphi 다른 버전과 함께 설치되어 있으면 더더욱 머리 아픈 상황이 연출되곤 했죠. 자아 이제 그 방법을 공개합니다~! http://support.codegear.com/article/39426 의 내용을 번역해보았습니다. 다음은 Delphi 2009, C++Builder 2009을 언인스톨하기 위한 일반적인 수순입니다.: Windows XP가 설치된 컴퓨터에서의 기본적인 수순입니다. “시작”메뉴에서 [CodeGear RAD Studio 2009 | Modify, Repair, Uninstall]을 선택하여, 언인스톨을 시작합니다. CodeGear RAD Studio를 설치했던 (디폴트 .. 더보기
Create a shortcut in the Startmenu, on the Desktop uses Registry, ActiveX, ComObj, ShlObj; type ShortcutType = (_DESKTOP, _QUICKLAUNCH, _SENDTO, _STARTMENU, _OTHERFOLDER); function CreateShortcut(SourceFileName: string; // the file the shortcut points to Location: ShortcutType; // shortcut location SubFolder, // subfolder of location WorkingDir, // working directory property of the shortcut Parameters, Description: string): // description proper.. 더보기
Create a standard windows shortcut file Q: How can I create a standard windows shortcut file (*.lnk) from my Delphi application? A: Below is an example that creates a shortcut to a DOS batch file. You need to use the procedure CreateLink(); program kg_MakeLink; {****************************************************************} {* Programmer: Kevin S. Gallagher *} {* *} {* Language: Delphi 3.00, 32 bit *} {* All code is within this one.. 더보기