Click here to Skip to main content
15,902,189 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how to proceed?? [modified] Pin
debonair12345630-Dec-08 0:52
debonair12345630-Dec-08 0:52 
QuestionWhat wrong with this code? Pin
SNI29-Dec-08 0:50
SNI29-Dec-08 0:50 
GeneralRe: What wrong with this code? Pin
Malli_S29-Dec-08 1:01
Malli_S29-Dec-08 1:01 
GeneralRe: What wrong with this code? Pin
SNI29-Dec-08 1:20
SNI29-Dec-08 1:20 
GeneralRe: What wrong with this code? Pin
Malli_S29-Dec-08 2:50
Malli_S29-Dec-08 2:50 
QuestionProblem about injecting a dll to another process and use it to send menu message issues. Pin
kcynic28-Dec-08 23:28
kcynic28-Dec-08 23:28 
GeneralRe: Problem about injecting a dll to another process and use it to send menu message issues. Pin
Malli_S28-Dec-08 23:52
Malli_S28-Dec-08 23:52 
GeneralRe: Problem about injecting a dll to another process and use it to send menu message issues. Pin
kcynic29-Dec-08 3:51
kcynic29-Dec-08 3:51 
I wrote enumwindows callback function like following:
BOOL CALLBACK EnumWindowsProc(HWND hwnd, LPARAM lParam)
{
	DWORD procId;
	GetWindowThreadProcessId(hwnd,&procId);
	log_message("Main window search callback function is called.");
	if(procId==(DWORD)lParam){

          ....the message would to be send here
         
           return FALSE;
         }
   return TRUE;
}


I send the menu message in two ways:
1. HMENU trayMenu = GetMenu(hwnd);
if(trayMenu!=NULL){//usually equal to NULL, and according to the failure in method 2(send msg no response) i think i got the wrong hwnd handle
HMENU subMenu = GetSubMenu(trayMenu,0);
if(subMenu!=NULL){
DWORD menuItemId=GetMenuItemID(subMenu,0);
if(menuItemId!=-1)
SendMessage(hwnd,WM_COMMAND,menuItemId,0);
}
}

2.Because i can get the menu resource id, and, this code is implemented in a injected dll to the target process, so, there is a second method here:
HMENU trayMenu = LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDM_MENU));
if(trayMenu!=NULL){//successfully always
...the other code looks the same with the method 1, but the target process's specified routine will not be actived, because its no response.
GeneralRe: Problem about injecting a dll to another process and use it to send menu message issues. Pin
Malli_S29-Dec-08 21:00
Malli_S29-Dec-08 21:00 
AnswerRe: Problem about injecting a dll to another process and use it to send menu message issues. Pin
kcynic8-Jan-09 18:29
kcynic8-Jan-09 18:29 
QuestionCertificate usage Pin
Sunil P V28-Dec-08 21:25
Sunil P V28-Dec-08 21:25 
QuestionLinking Error Pin
Aabid28-Dec-08 20:15
Aabid28-Dec-08 20:15 
AnswerRe: Linking Error Pin
Malli_S28-Dec-08 21:08
Malli_S28-Dec-08 21:08 
GeneralRe: Linking Error Pin
Aabid28-Dec-08 21:33
Aabid28-Dec-08 21:33 
GeneralRe: Linking Error Pin
Malli_S28-Dec-08 22:16
Malli_S28-Dec-08 22:16 
AnswerRe: Linking Error Pin
Sarath C28-Dec-08 21:12
Sarath C28-Dec-08 21:12 
GeneralRe: Linking Error Pin
Aabid28-Dec-08 21:36
Aabid28-Dec-08 21:36 
GeneralRe: Linking Error Pin
Sarath C28-Dec-08 22:05
Sarath C28-Dec-08 22:05 
QuestionProblems with CStatic GetBitmap Pin
JJeffrey28-Dec-08 20:02
JJeffrey28-Dec-08 20:02 
AnswerRe: Problems with CStatic GetBitmap Pin
Code-o-mat29-Dec-08 3:48
Code-o-mat29-Dec-08 3:48 
GeneralRe: Problems with CStatic GetBitmap Pin
JJeffrey29-Dec-08 13:11
JJeffrey29-Dec-08 13:11 
GeneralRe: Problems with CStatic GetBitmap Pin
Code-o-mat29-Dec-08 21:56
Code-o-mat29-Dec-08 21:56 
QuestionAllocating Memory from Physical Memory not Virtual Memory? Pin
a_kiani28-Dec-08 19:42
a_kiani28-Dec-08 19:42 
AnswerRe: Allocating Memory from Physical Memory not Virtual Memory? Pin
Hamid_RT28-Dec-08 20:01
Hamid_RT28-Dec-08 20:01 
AnswerRe: Allocating Memory from Physical Memory not Virtual Memory? Pin
Maxwell Chen28-Dec-08 20:12
Maxwell Chen28-Dec-08 20:12 

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.