Esempio n. 1
0
void CTransCtrl::RemoveHook( )
{
	DWORD (WINAPI *lpfProc)( void );

	if( hInst_res_x86 != NULL )
	{

		 // Get procedure address.
		lpfProc = (DWORD(WINAPI *)(void))
			GetProcAddress( hInst_res_x86, "StopHookThreadProc" );		

		if( lpfProc != NULL )
		{
			DWORD err = lpfProc( );
			if( !err )
			{
				if( ReadIntSetting( "res_x86", "address", 0 ) != 0 )
					UnhookWindowsHookEx( m_hhook );
			}
			else __Error( err );
			
		}
		else __Comment( "function not found in resource library" );		 
	}
	else __Comment( "resource library not loaded" );

	/////////////////////////////////////////////////

		
	m_hhook = NULL;
	m_bHooked = false;

	__Comment( "Desktop Control: Hook Removal" );
	
}
Esempio n. 2
0
void tool::source::Column::Newline(const SizeType& column, 
	std::string string)
{
	if (column > m_maximum)
	{
		__Error("Check Column Failed: columns greater than %zu (Column = %zu) "
			", file %s, line %zu, string \"%s\"", m_maximum, column, 
			m_read.Pathname().c_str(), m_line, string.c_str());
	}
	else
	{
		if (IsDebug())
		{
			__Info("line %zu, column %zu, string \"%s\"", 
				m_line, column, string.c_str());
		}
	}
	++m_line;
}
Esempio n. 3
0
BOOL CTransCtrl::InstallHook( )
{

	int nReturn =  false;

	WriteIntSetting( "res_x86", "installed", 0 );	
	
	
	DWORD (WINAPI *lpfProc)( void );

    if( hInst_res_x86 != NULL )
	{

		 // Get procedure address.
		lpfProc = (DWORD(WINAPI *)(void))
			GetProcAddress( hInst_res_x86, "StartHookThreadProc" );		

		if( lpfProc != NULL )
		{		
			DWORD err = lpfProc( );
			if( !err ){
				nReturn = true;
				m_hhook = (HHOOK)ReadIntSetting( "res_x86", "address", 0 );					
				__Comment( "Hook Installed!" );
			}		
			else
				__Error( err );
			
		}
		else __Comment( "function not found in resource library" );
		
	}
	else __Comment( "resource library not loaded" );

	/////////////////////////////////////////////////

	
	m_bHooked = nReturn;
		
	return nReturn;
}
Esempio n. 4
0
void CTransCtrl::CreateButton()
{
	if( m_hButtonWnd )
		return;

	__Comment( "Creating Button..." );
	m_hButtonWnd = CreateWindowEx( WS_EX_TOOLWINDOW|WS_EX_TOPMOST, "button",
		"Show Icons", WS_POPUP, 1,1,20,20, GetMyWindowHandle(), 0,
		GetMyInstanceHandle(), 0 );

	if( m_hButtonWnd == NULL )
	{
		DWORD err = GetLastError();
		__Comment( "CTransCtrl::CreateButton() Failed" );
		__Error( err );		
	}
	else
	{
		__Comment( "...Button Created." );

		SetWindowLong( m_hButtonWnd, GWL_WNDPROC, (LONG)&ButtonWndProc );

	}
}