monoceres Posted August 6, 2008 Share Posted August 6, 2008 So I tried to follow Valiks advice in this post and I nearly succeeded, at least I think so I injected the code, so far so good.I replaced the default WndProc with my own. Also without problems.Filtering a message, now this is where the problems arise My code for the injected dll look like this:expandcollapse popup#include <windows.h> WNDPROC original; LRESULT CALLBACK SubWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { if (msg==WM_CLOSE) return 0; return DefWindowProc(hwnd,msg,wParam,lParam); //return CallWindowProcW(original,hwnd,msg,wParam,lParam); } BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ) { HWND hwnd; hModule; lpReserved; switch (ul_reason_for_call) { case DLL_PROCESS_ATTACH: MessageBoxW(NULL,L"I am now injected, hehehe",L"Injected",NULL); hwnd=FindWindowW(NULL,L"Sample"); original=(WNDPROC)SetWindowLongW(hwnd,GWL_WNDPROC,(long)SubWndProc); case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: case DLL_PROCESS_DETACH: break; } return TRUE; }If I inject it as it is now I totally screw up the window (duh), but if I call the original WndProc WM_CLOSE is still sent to it.I guess I have got everything upside-down again...Thanks in advance Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
monoceres Posted August 6, 2008 Author Share Posted August 6, 2008 Hmm this is weird. It works perfectly when trying with vlc instead of the autoit app I tested with first. Is autoit processing messages in a special way? Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
LarryDalooza Posted August 6, 2008 Share Posted August 6, 2008 Is autoit processing messages in a special way?Assuredly.Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now