Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: STL - What is the simplest way to implement this Pin
Tomasz Sowinski24-Sep-01 23:55
Tomasz Sowinski24-Sep-01 23:55 
GeneralSetCommState hangs in Windows CE Pin
24-Sep-01 21:52
suss24-Sep-01 21:52 
GeneralPrevent from getting Window Handle Pin
NitramR24-Sep-01 21:17
NitramR24-Sep-01 21:17 
GeneralRe: Prevent from getting Window Handle Pin
Tomasz Sowinski25-Sep-01 0:04
Tomasz Sowinski25-Sep-01 0:04 
GeneralRe: Prevent from getting Window Handle Pin
NitramR25-Sep-01 5:18
NitramR25-Sep-01 5:18 
GeneralRe: Prevent from getting Window Handle Pin
Tomasz Sowinski25-Sep-01 5:30
Tomasz Sowinski25-Sep-01 5:30 
GeneralRe: Prevent from getting Window Handle Pin
NitramR25-Sep-01 5:59
NitramR25-Sep-01 5:59 
GeneralRe: Prevent from getting Window Handle Pin
Stephen Kellett25-Sep-01 13:21
Stephen Kellett25-Sep-01 13:21 
Hello NitramR,

Try this idea. I haven't checked it out, but it should work. There are a few different ways of acheiving the end result.

1a) System wide hook that hooks each process. This loads your spy DLL into their process when their process starts.
1b) Use CreateRemoteThread() to inject your DLL into the running process. You'll need a thread to watch for new processes and then inject your DLL into each new process. This is more complicated than a system wide hook, but acheives the same result.

2) Your DLL will then hook the Kernel/User/GDI/whatever DLL functions that you think are appropriate. In this case you'll want to be hooking User32 functions related to finding windows.

In your hooks you'll let the function execute then examine the return value before returning. If the value indicates your window you'll overwrite the value to indicate failure.

3) Their program will search for the window and fail.

There is info on hooking technique elsewhere on this site and also in MSJ/MSDN website/magazine.

Caveats.
--------
If they know which DLL you are loading they may be able to write code to hook LoadLibrary and LoadLibraryEx and prevent the library from loading dy diverting the function call and returning a library not loaded return code. Not hard to do. If they get their hooks in before you get your hooks in, you have lost the battle.

Cheers

Stephen Kellett
--
C++/Java/Win NT/Unix variants
Memory leaks/corruptions/performance/system problems. UK based.
Problems with RSI/WRULD? Contact me for advice.

GeneralRe: Prevent from getting Window Handle Pin
NitramR27-Sep-01 5:45
NitramR27-Sep-01 5:45 
GeneralRe: Prevent from getting Window Handle Pin
NitramR30-Sep-01 21:10
NitramR30-Sep-01 21:10 
Generaldll Pin
24-Sep-01 21:00
suss24-Sep-01 21:00 
GeneralRe: dll Pin
#realJSOP25-Sep-01 1:37
professional#realJSOP25-Sep-01 1:37 
GeneralQ: How to get flat scrollbars in CTreeCtrl Pin
Roar Brekken24-Sep-01 20:54
Roar Brekken24-Sep-01 20:54 
GeneralRe: Q: How to get flat scrollbars in CTreeCtrl Pin
Tomasz Sowinski25-Sep-01 0:14
Tomasz Sowinski25-Sep-01 0:14 
QuestionIs it possible to recursively call OnPrint or am I way off? Pin
DanYELL24-Sep-01 17:54
DanYELL24-Sep-01 17:54 
AnswerRe: Is it possible to recursively call OnPrint or am I way off? Pin
Paul Selormey24-Sep-01 18:08
Paul Selormey24-Sep-01 18:08 
GeneralWM_MOUSEWHEEL in child window of ActiveX control Pin
Paul Selormey24-Sep-01 17:16
Paul Selormey24-Sep-01 17:16 
GeneralCreateWindow problem in Win32 Pin
Christian Graus24-Sep-01 15:01
protectorChristian Graus24-Sep-01 15:01 
GeneralRe: CreateWindow problem in Win32 Pin
Paul Selormey24-Sep-01 17:19
Paul Selormey24-Sep-01 17:19 
GeneralRe: CreateWindow problem in Win32 Pin
Christian Graus24-Sep-01 17:36
protectorChristian Graus24-Sep-01 17:36 
GeneralRe: CreateWindow problem in Win32 Pin
Paul Selormey24-Sep-01 18:11
Paul Selormey24-Sep-01 18:11 
GeneralRe: CreateWindow problem in Win32 Pin
Christian Graus24-Sep-01 19:34
protectorChristian Graus24-Sep-01 19:34 
GeneralRe: CreateWindow problem in Win32 Pin
Paul Selormey24-Sep-01 20:01
Paul Selormey24-Sep-01 20:01 
GeneralRe: CreateWindow problem in Win32 Pin
Mike Burston24-Sep-01 21:53
Mike Burston24-Sep-01 21:53 
GeneralRe: CreateWindow problem in Win32 Pin
Christian Graus24-Sep-01 22:07
protectorChristian Graus24-Sep-01 22:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.