윈도우즈 MFC JavaScript WIN32 PHP 이미지 GDI+ WINCE activex version 스크랩 폴더 string 작업관리자 DirectShow capture shutdown shortcut folder process directory image DirectX grab 버젼 wave 파일속성 shellexecute 공유폴더 단축아이콘 빈폴더 스크린세이버 video tray toolbar taskmanager strfnd screensaver resolution local icon ExitProcessName crop awt attribute ATL address

IMAGE.ZIP

동적 이미지(실시간 그래프) 생성하기   (created at 2006-12-22)   241  

http://www.acme.com/java/software/Acme.JPM.Encoders.GifEncoder.html에서 다운받은 Acme.tar.gz을 알집이나 윈집을 이용해서 압축을 풉니다. 필요한 파일이, Acme 라는 디렉토리 안에 JPM 디렉토리가 있고 그 안에는 Encoders 라는 디렉토리가 있고 그 안에는 class 파일이 두개 있습니다. Acme 디렉토리를 WEB-INFclasses 아래로 이동합니다. 어딘지 아시죠? 아니면 제가 첨부...

이미지를 지정된 비율로 자르기 (crop)   (created at 2006-10-10)   216  

PC 셧다운 (shutdown)   (created at 2006-09-29)   132  

셧다운 해주는 기능은 다음과 같이 구현 할 수 있다.procedure ExitWin2000(ewx: integer);varhToken: THANDLE;hProc: THANDLE;mLUID: TLargeInteger;mPriv, mNewPriv: TOKEN_PRIVILEGES;mBufferLength: DWord;beginif not (ewx in [1, 2]) then  exit;hProc := GetCurrentProcess();Ope...

스크린세이버 동작 못하게 막아주기   (created at 2006-09-29)   233  

Good question, and yes you can disable the Windows screen saver at runtime. It just so happens that just before Windows activates its screen saver, it sends out a SC_SCREENSAVE message to all running programs. If any of them set the message's Result field ...

로컬 IP 알아내기   (created at 2006-09-29)   160  

uses Winsock; function GetIPFromHost(var HostName, IPaddr, WSAErr: string): Boolean;typeName = array[0..100] of Char;PName = ^Name;varHEnt: pHostEnt;HName: PName;WSAData: TWSAData;i: Integer;beginResult := False;if WSAStartup($0101, WSAData) 0 thenbegin&nb...

공유폴더 찾아주기   (created at 2006-09-29)   203  

Good day.I need to know how to list shared folders on a computer that I am connected over LAN to, given its IP or machine name.Thanks ahead. ========================================================================================================Accepted An...

DirectShow에서 비디오 출력 크기 조정해주기   (created at 2006-09-29)   223  

PinOut := GetPin(VideoCapture, 'Preview');PinOut.EnumMediaTypes(MediaEnum);While MediaEnum.Next(1, MediaType, nil) = S_OK doBeginif GUIDToString(MediaType.subtype) = GUIDToString(MEDIASUBTYPE_RGB24) thenbegin   New(MediaType2);   CopyMe...

ShellExecute 실행 끝날때 까지 기다리기   (created at 2006-09-29)   194  

엄청난 비기 임... 흐흐흐...uses ShellAPI;{Supply a fully qualified path name in ProgramName}procedure KShellExecute(exe, param, dir: String);varExitCode: DWORD;SEInfo: TShellExecuteInfo;beginFillChar(SEInfo, SizeOf(SEInfo), 0);SEInfo.cbSize := SizeOf(TShellExecuteI...

Extracting a Program's Version Information   (created at 2006-09-29)   176  

The Unofficial Newsletter of Delphi Users - by Robert Vivrette --------------------------------------------------------------------------------Extracting a Program's Version Information by Michael Burton - rimrock@rimrocksoftware.com Delphi 3 and Delphi 4 ...

Starting an application as an icon in the system tray   (created at 2006-09-29)   114  

  Copyright © 2000 Ernesto De SpiritoDownload the source codePlacing an icon the system trayThe system tray is the area at the right of the task bar where "background" applications can place their icons. To place an icon in the tray you have to call t...

Create a standard windows shortcut file   (created at 2006-09-29)   182  

  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;{*******************...

디렉토리와 그 안에 있는 모든 파일 지우기   (created at 2006-09-29)   192  

  procedure TForm1.Button1Click(Sender: TObject);var  DirInfo: TSearchRec;  r : Integer;begin  r := FindFirst('C:DownloadTest*.*', FaAnyfile, DirInfo);  while r = 0 do  begin    if ...

디렉토리 복사 루틴 (하부디렉토리까지 몽땅)   (created at 2006-09-29)   155  

  Procedure TForm1.DirectoryCopy(Sourcedir :string; Destdir: string);var  Pstr : array[0..256] of char;

File Attribute 바꾸는 방법   (created at 2006-09-29)   205  

  procedure TForm1.Button1Click(Sender: TObject);begin  with OpenDialog1 do    if Execute then      if SetFileAttributes(PChar(Filename), FILE_ATTRIBUTE_HIDDEN) then    &n...

wave 파일 mixing 하기. (웨이브 믹싱)   (created at 2006-09-29)   292  

용도는.. 배경음에다 목소리 합칠때 사용하는 겁니다.검증은 좀 덜됐지만, 이런식으로 하면.. 얼마든지 응용이 가능할꺼 같네요.그럼.. 문제 있으시면 답글 부탁드립니다.   // WAVE 파일을 Mixing 한다. - 배경음 + 목소리용// [in] pFile1 : 목소리 파일// [in] pFile2 : 배경음 파일(목소리 파일보다 커야한다.)// [in]nPreMargineSec : 몇초 후부터 음성을 합칠것인가. (배경음만 ...

ATL/ActiveX 에서 자바스크립트로 데이터(문자열) 보내기   (created at 2006-09-29)   236  

음.. 보통 param 으로 엑티브X로 값을 넘겨 받아서 쓰는데요그 반대도 궁금해서 찾아봤더니 자료가 별로 없더군요.혹시나 해서 올립니다.1. 클래스뷰 인터페이스항목에서 메서드를 추가합니다2. 매개 변수 형식을 VARIANT*  로 하고 특성에 out과 retval을 설정합니다. (메서드 이름과 변수 이름은 적당히...)3. 구현부분을 다음과 같이 합니다.STDMETHODIMP CTest::TestMethod(VARIANT* pVal){ ...

System Log-Off, Suspend, Reboot, Shutdown 시키기   (created at 2006-09-29)   187  

윈도우에서 시스템 Shutdown, Reboot, Log-Off는 ExitWindowsEx 함수로, Suspend는 SetSystemPowerState 함수로 가능합니다.윈도우 NT를 베이스로 하는 2000, XP의 경우는 시스템을 컨트롤 하기 위해서는 권한을 변경하는 과정이 필요합니다. BOOL IsWindowsNT(){    OSVERSIONINFO verInfo;     verInfo.d...

GDI+ 에서 이미지 반투명 처리하기..   (created at 2006-09-29)   219  

GDI 에선 AlphaBlend 라는 함수로 가능하기는 하는데찍을 부분의 이미지 색상과 혼합을 해야 제대로 구현이 됩니다계산식이야 MSDN 에도 있고 여기 Q&A 에 검색해도 있습니다.AlphaBlend 로 하다가 계산하는거 짜증나서GDI+ 찾아 보니까 있더군여..MSDN 에서 발췌했습니다.여기 검색해봐도 없길래... 갖다 붙여 넣습니다... 참고하세요..  Using a Color Matrix to Set Alpha Values in ...

자기자신 IP알아내기(로칼컴퓨터)   (created at 2006-09-29)   180  

^^.여러가지 방법이 올라와 있지만 제 컴에는 이넘 밖에 되지 않았습니다.Test 컴파일러 : VC++6.0 , VC++.NET  #include #include #include #pragma comment(lib, "ws2_32.lib")    CString CLogToNmdDlg::GetMyIp(void){      CString strHostName="";&nb...

프로세스명으로 프로세스 죽이는 함수   (created at 2006-09-29)   189  

/*    사용법 : ExitProcessName("IEXPLORE.EXE");

빈폴더 찾아내기   (created at 2006-09-29)   155  

주어진 경로 하위에 위치한 빈폴더를 모두 찾아내 삭제하는 함수입니다.수정해야 할부분이 있다면 알려주세요 ^^BOOL DelEmptyFolder(CString strPath){           CFileFind finder;    int nValidCnt = 0;    BOOL bWork...

IE 패치에 따른 object, embed, applet 대처 방안   (created at 2006-09-28)   274  

기존 방법↓Embed.jsdocument.write(‘’);단점 : embed 시킬 파일마다 js파일을 생성해주어야함 ㅡㅡa

HTML 긁어오는 프로그램 소스   (created at 2006-09-28)   132  

Your first task is to create a Delphi function used to download a file from the Internet. One way of achieving this task is to use the WinInet API calls. Delphi gives us full access to the WinInet API (wininet.pas) which we can use to connect to and retrie...

파일에서 한줄만 읽어다 return 해주는 소스   (created at 2006-09-28)   211  

 function read_line_1($filename)  {    $fp=fopen($filename, "rb");    $buff=fgets($file, 40960);    fclose($fp);    return trim($buff);  }

작업관리자에 프로그램 안뜨게 하기   (created at 2006-09-28)   322  

작업관리자를 띄워보면 어떤 프로그램이 떠 있는지 다 나온다.이걸 막으려먼 프로젝트 소스에서 다음과 같이 초기화를 해주면된다....Application.Initialize;Application.Title := '';Application.CreateForm(TForm1, Form1);...이렇게 해주면 Taskbar에도 안뜬다.

String Find Function (StrFnd)   (created at 2006-09-28)   143  

특정 문자열을 찾아내 주는 소스.델파이 프로그래밍 할 때마다 자주 애용하는 소스이다.  function StrFnd( source, key: String): Integer;vari, j, flen, slen, klen: Integer;beginslen := Length( source);klen := Length( key);flen := slen - klen + 1;for i := 1 to flen dobegin   if sour...

Toolbar에서 Icon 없애기   (created at 2006-09-28)   153  

  ::OnInitDialog(....){...//작업 표시줄에서 버튼을 없애준다.DWORD dwStyle = GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE);dwStyle &= ~WS_EX_APPWINDOW;SetWindowLong(this->GetSafeHwnd(), GWL_EXSTYLE, dwStyle);...}

웹브라우져가 떠서 웹페이지 보이게 하는 소스   (created at 2006-09-28)   235  

참으로 간단하다.ShellExecute라는 함수를 쓰면 된다.// ShellExecute(Application.Handle, nil, PCHAR(strWorkingDir), nil, '', SW_SHOW);ShellExecute( NULL, NULL, "http://m.kurapa.com", NULL, "", SW_SHOW);

ActiveX에 다이얼로그 붙이기   (created at 2006-09-28)   223  

ActiveX Control안에 다른 ActiveX Control을 올려놓을때는 차일드 속성외에..app에 initinstance에서 AfxEnableControlContainer();를 호출해줘야 합니다..예..BOOL CClientApp::InitInstance(){BOOL bInit = COleControlModule::InitInstance();if (bInit){// TODO: Add your own module initialization cod...

드라이브 문자 알아내는 소스   (created at 2006-09-28)   211  

내가 사용하고 있는 PC에서 드라이브가 어떤게 사용가능한지 알아내는 소스.void CDriveCheckUtilDlg::CheckForDriveLetterAccess(){  char m_DriveLetter[80]={ "

ListCtrl에서 아이템 추가하기 예제   (created at 2006-09-28)   341  

char *strTitle, *strArtist, *strTime;{/* Add song information to play list */LV_ITEM lvitem;lvitem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE ;//  lvitem.iImage = MemoryType - 1; /* Set Image Type */lvitem.state =  0;lvitem.stateMask = ...

ActiveX에서 바이너리 데이터 파라메터로 안깨지게 받는법   (created at 2006-09-28)   266  

보통 LPCTSTR로 선언해서 쓰는데 그럼 가다가 end of string 이후가 깨져버린다.그때 파라메터를 CHAR * 로 선언해서 쓰면된다.Visual C++ 6.0에서는 CHAR* 선언이 불가능하므로 수동으로 고쳐주면된다.이때 컨트롤 부분에서는 다음과 같은 부분도 수정해주어야 한다.VTS_BSTR로 선언되어진 부분을 VTS_PI1로 선언해주면된다.그러면 데이터 송수신시 깨지지 않는다.from ControlDISP_FUNCTION(CKlientCtrl...

모달리스 다이얼로그의 종료 버튼을 클릭했을 때 종료가 안될때...   (created at 2006-09-28)   208  

모달리스 다이얼로그의 종료 버튼을 클릭했을 때 종료가 안될때...요로코롬 해보슈~WndProc(..){switch(){   case WM_SYSCOMMAND:   {     if(wParam==SC_CLOSE)     {       EndDialog();//종료   &n...

DirectShow - NULL Rendering Example   (created at 2006-09-28)   170  

DirectShow를 이용하여 간단히 컨텐츠를 재생하는 프로그램 소스다.이것만 이해하면 DirectShow의 절반은 이해 한 셈이다.#include #pragma comment(lib, "strmiids.lib")

Broadcast를 이용한 Application 종료   (created at 2006-09-28)   280  

가끔 어플리케이션을에게 메시지를 보내서 통채로 죽이고 싶을때가 있다.어플리케이션들아 우리 같이 종료하자!!!이럴때는 윈도우 메시지를 정의해놓고,브로드케스트 해주는 방법을 써주면 좋다. 보내는 곳UINT nCloseRegMsg = ::RegisterWindowMessage("ISCREEN_CP_APP");::PostMessage(HWND_BROADCAST, nCloseRegMsg, 0, 0);받는 곳UINT nCloseRegMsg = ::Regis...

IE Control을 사용하여 만든 어플리케이션에서 javascript로 어플리케이션에 정의된 함수 호출하는 방법   (created at 2006-09-28)   286  

Embedded XP같은거 사용해서 커스톰 웹브라우져같은거 만들때 이런 방법을 많이 쓴다.셋톱박스 전용 브라우져 만들때 꼭 써야하는 방식이라고나 할까...내용 요약:IE Control을 사용하여 개발하는 어플리케이션 내에 정의된 함수를 javascript로 window.external.[사용자 정의 함수] 로 호출하는 방법.기본적으로는 함수는 Public으로 정의하여 구현하면 IE위에서 돌아가는 javascipt에서도 Call할수 있다.# call방법wi...

윈도우 옮기는 API - SetWindowPos   (created at 2006-09-28)   287  

 The SetWindowPos function changes the size, position, and Z order of a child, pop-up, or top-level window. Child, pop-up, and top-level windows are ordered according to their appearance on the screen. The topmost window receives the highest rank and ...

CFileDialog - File Open Example   (created at 2006-09-28)   178  

CFileDialog l_SampleDlg(TRUE,NULL,NULL,OFN_OVERWRITEPROMPT,"Text Files (*.txt)|*.txt|Comma Separated Values(*.csv)|*.csv||");      int iRet = l_SampleDlg.DoModal();      CString l_strFileName;&nbs...

GDI+ Programming 방법   (created at 2006-09-28)   272  

 [중요1] Graphics 개체를 사용한다.[중요2] 다음의 헤더선언을 꼭 해야된다        #include         using namespace Gdiplus;        #pragma comment(lib, "gdipl...

투명 윈도우 만들기   (created at 2006-09-28)   197  

You should be able to use this demo as a skeleton application for your own project.A standard CDialog MFC EXE application was created with the wizard and apart from the standard supplied code, the following functions were overridden.void OnClose() Used to ...

불투명 윈도우 만들기   (created at 2006-09-28)   228  

 * 불투명 윈도우 만들기방금전에 책에서 본 예제로 만든겁니다.님의 코드보다 더 자원을 먹을지는 모르겠지만 참고하세요.윈도 2000이상에서만 된다고 하네요.전역입니다 :// 투명 설정을 위한 상수 정의#define WS_EX_LAYERED       0x00080000#define LWA_ALPHA         ...

마우스로 윈도우 드래그하여 이동시키는 비기   (created at 2006-09-28)   391  

윈도우 드래그해서 움직이고 싶은데 어떻게 하는지 모르시는 분은 다음의 이벤트를 추가해 보시라.  void Cgdiplus_demoDlg::OnLButtonDown(UINT nFlags, CPoint point){        // 다음과 같이 PostMessage를 넣어주면 간단히 구현 가능        ...

비트맵을 배경으로 뿌리고 그 위에 컨트롤 올리는 방법   (created at 2006-09-28)   225  

사실은 별루 하는 일 없다.원래 VC++ 프로그램 짜듯 짜되,배경이미지를 하나 로딩해서 매번 Paint 해주면 된다.다음과 같이 클레스 선언부에 m_BG라는 비트맵을 선언HBITMAP m_BG초기화 부분에서 비트맵 로드한다음BOOL CCALLIDDlg::OnInitDialog(){        CDialog::OnInitDialog();    &nb...

WinCE에서 Key Hooking하는 방법   (created at 2006-09-28)   385  

MSDN에서 알아낸 PDA폰에서의 키 후킹하는 방법입니다.=======================================================================================삼성 SPH-M4300에서 프로그래밍 해보고 테스트도 완료했습니다.잘되더군요.더 자세한 정보를 알아보시려면 다음의 뉴스그룹을 참조하시고:http://groups.google.com/group/microsoft.public.win...

BITMAP 오브젝트에서 가로,세로 크기 알아내기   (created at 2006-09-28)   347  

 열라 간단.int GetCBitmapWidth(const CBitmap & cbm){      BITMAP bm;      cbm.GetObject(sizeof(BITMAP),&bm);      return bm.bmWidth;}int GetCBitmapHeight(const CBitm...

듀얼 모니터에서 Focused Monitor의 Rect 알아내기   (created at 2006-09-28)   282  

    HMONITOR hMonitor;    MONITORINFO mi;    RECT        rc;    // get the nearest monitor to the passed rect.    hM...

비트맵을 파일에서 로딩하는 비기   (created at 2006-09-28)   319  

파일로부터 비트맵을 로딩하는 비기 (Loading Bitmaps from a File)Type : Tips & TricksReferences :Posted by dougalliNotes : Originally posted to the VST-plugins mailing list by Sandor Drieënhuizen Only works in WindowsCode : class CBitmapEx : public CBitmap{  &nbs...

프로그램에서 버젼(version) 정보 읽어주는 소스   (created at 2006-09-28)   299  

가끔 MFC나 Delphi로 프로그램 만들다 보면,내가 만든 프로그램에 포함된 리소스에서 버젼을 읽어오고 싶을때가 있다.본 소스는 버젼을 읽어다 뿌려주는 샘플코드입니다.다음의 코드를 상단부에 선언하시고String GetVersionInfo(HMODULE hLib, CString csEntry){    CString csRet;        if (hLib == NULL)&nb...

RDP(Remote Desktop Protocol) Port 값 가져오고/바꿔주기   (created at 2006-09-28)   3,202  

리모트 데스크탑 포트 번호 바꿔주는 프로그램 소스입니다.첨부파일은 이를 구현한 어플리케이션입니다. DWORD GetRDPPortNo(){ HKEY hKey; long dwSize=0; DWORD PortNo=3389; DWORD dwDisp, dwType; if (RegCreateKeyEx(  HKEY_LOCAL_MACHINE,     &n...