home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Best of Windows 95.com 1996 September
/
WIN95_09964.iso
/
patches
/
sloth01.zip
/
SLOTH.CPP
next >
Wrap
C/C++ Source or Header
|
1996-08-27
|
1KB
|
72 lines
#include <windows.h>
#include <winbase.h>
#include <dde.h>
#include <ddeml.h>
HINSTANCE hinst;
HWND hwndMain;
int APIENTRY WinMain(
HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpszCmdLine,
int nCmdShow
)
{
//MSG msg;
//WNDCLASS wc;
//UNREFERENCED_PARAMETER(lpszCmdLine);
//char* SlothName;
// HINSTANCE hRet;
// SlothName = lpszCmdLine ;
/*
hRet = ShellExecute
(
::GetDesktopWindow(),
"open",
"powwow.exe",
lpszCmdLine+7,
NULL,
SW_SHOW
);
*/
DWORD theWord;
theWord =0;
DdeInitialize(&theWord,NULL,APPCMD_CLIENTONLY,0);
HSZ hszService;
hszService =DdeCreateStringHandle( theWord,"Powwow",CP_WINANSI);
HSZ hszTopic;
hszTopic =DdeCreateStringHandle( theWord,"WWW_OpenURL",CP_WINANSI);
HCONV hcnv;
hcnv=DdeConnect(theWord,hszService, hszTopic,NULL );
HSZ hszData;
hszData = DdeCreateStringHandle( theWord,
lpszCmdLine,
CP_WINANSI
);
DdeClientTransaction((unsigned char *)NULL,
(DWORD)0,
hcnv,
hszData,
CF_TEXT,
XTYP_REQUEST,
1000, // ms timeout
NULL);
DdeFreeStringHandle(theWord, hszService);
DdeFreeStringHandle(theWord, hszTopic);
DdeFreeStringHandle(theWord, hszData);
DdeDisconnect(hcnv);
DdeUninitialize(theWord);
return TRUE;
}