KpyM Telnet/SSH Server - Forum
Source of fixcut.exe |
Carlos |
Source of fixcut.exe |
Sep 21 2009 17:16 |
|
There are the source of fixcut.exe ?
|
Kroum Grigorov |
|
Sep 27 2009 19:23 |
|
Fixscut is part of the installation process and is not directly used by KTS. This is used to adjust the session.exe.lnk shortcut.
Here's the source
---------------------------------
#include <windows.h>
#include <shlobj.h>
#include <stdio.h>
BOOL ChangeShortcut( char *pcLinkFile, char *pcTarget ){
HRESULT hres;
WCHAR awcLinkFile[ MAX_PATH ];
IShellLink *pIsl;
IPersistFile *pIpf;
CoInitialize( NULL );
hres = CoCreateInstance( CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, ( void** )&pIsl );
if( !SUCCEEDED(hres) ){
printf("CoCreateInstance:err\n" );
CoUninitialize( );
return( FALSE );
}
hres = pIsl->QueryInterface( IID_IPersistFile, ( void** )&pIpf );
if( !SUCCEEDED(hres) ){
printf("QueryInterface:err\n" );
CoUninitialize( );
return( FALSE );
}
if( !MultiByteToWideChar(CP_ACP, 0, pcLinkFile, -1, awcLinkFile, MAX_PATH) ){
printf("MultiByteToWideChar:err\n" );
CoUninitialize( );
return( FALSE );
}
hres = pIpf->Load( awcLinkFile, STGM_READWRITE );
if( !SUCCEEDED(hres) ){
printf("Load:err\n" );
CoUninitialize( );
return( FALSE );
}
pIsl->SetPath( pcTarget );
pIpf->Save( awcLinkFile, TRUE );
pIpf->Release();
pIsl->Release();
CoUninitialize( );
return( TRUE );
}
void main(){
char acLinkFile[ MAX_PATH ];
char acTarget[ MAX_PATH ];
char acPath[ MAX_PATH ];
GetModuleFileName( NULL, acPath, MAX_PATH - 1 );
acPath[ strlen( acPath ) - strlen( "fixscut.exe" ) - 1 ] = ( char )0;
sprintf( acLinkFile, "%s\\session.exe.lnk", acPath );
sprintf( acTarget, "%s\\session.exe", acPath );
if( !ChangeShortcut( acLinkFile, acTarget ) ){
printf("ChangeShortcut:err\n" );
}
}
|
© 2007 - 2008 Kroum Grigorov