home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09964.iso / patches / sloth01.zip / SLOTH.CPP next >
C/C++ Source or Header  |  1996-08-27  |  1KB  |  72 lines

  1. #include <windows.h>
  2. #include <winbase.h>
  3. #include <dde.h>
  4. #include <ddeml.h>
  5. HINSTANCE hinst;  
  6. HWND hwndMain; 
  7.  
  8. int APIENTRY WinMain(
  9.                      HINSTANCE hInstance,
  10.                      HINSTANCE hPrevInstance,
  11.                      LPSTR lpszCmdLine, 
  12.                      int nCmdShow
  13.                      ) 
  14.  
  15.     //MSG msg; 
  16.     //WNDCLASS wc; 
  17.     //UNREFERENCED_PARAMETER(lpszCmdLine); 
  18.      //char* SlothName;
  19. //    HINSTANCE hRet;
  20. //    SlothName = lpszCmdLine ;
  21.     /*
  22.     hRet = ShellExecute
  23.         (
  24.             ::GetDesktopWindow(),
  25.             "open",
  26.             "powwow.exe",
  27.             lpszCmdLine+7,
  28.             NULL,
  29.             SW_SHOW
  30.         );
  31.         */
  32.     
  33.     DWORD theWord;
  34.     theWord =0;
  35.  
  36.     DdeInitialize(&theWord,NULL,APPCMD_CLIENTONLY,0);
  37.     HSZ hszService; 
  38.     hszService =DdeCreateStringHandle( theWord,"Powwow",CP_WINANSI);
  39.     HSZ hszTopic; 
  40.     hszTopic =DdeCreateStringHandle( theWord,"WWW_OpenURL",CP_WINANSI);
  41.     HCONV hcnv;
  42.     hcnv=DdeConnect(theWord,hszService,    hszTopic,NULL ); 
  43.  
  44.     HSZ hszData;
  45.     
  46.  
  47.     hszData = DdeCreateStringHandle( theWord,
  48.                 lpszCmdLine,
  49.                 CP_WINANSI
  50.         );
  51.  
  52.  
  53.      DdeClientTransaction((unsigned char *)NULL,
  54.                      (DWORD)0,
  55.                      hcnv,
  56.                      hszData,
  57.                      CF_TEXT,
  58.                      XTYP_REQUEST,
  59.                      1000, // ms timeout
  60.                      NULL);
  61.  
  62.     
  63.     DdeFreeStringHandle(theWord, hszService);
  64.     DdeFreeStringHandle(theWord, hszTopic);
  65.     DdeFreeStringHandle(theWord, hszData);
  66.     DdeDisconnect(hcnv);
  67.     DdeUninitialize(theWord);
  68.     return TRUE;
  69.     
  70.