Click here to Skip to main content
15,919,341 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: encryption and decryption in vc++ Pin
shiraztk8-Feb-05 0:15
shiraztk8-Feb-05 0:15 
GeneralRe: encryption and decryption in vc++ Pin
namaskaaram8-Feb-05 0:58
namaskaaram8-Feb-05 0:58 
QuestionHow to define size for CTreeView's branches Pin
bilas7-Feb-05 23:14
bilas7-Feb-05 23:14 
AnswerRe: How to define size for CTreeView's branches Pin
Fred D.8-Feb-05 0:05
Fred D.8-Feb-05 0:05 
GeneralRe: How to define size for CTreeView's branches Pin
bilas8-Feb-05 3:55
bilas8-Feb-05 3:55 
Questionhow power point slids integrate with vc++ MFC diloge? Pin
syed abbdul qavi7-Feb-05 23:11
syed abbdul qavi7-Feb-05 23:11 
AnswerRe: how power point slids integrate with vc++ MFC diloge? Pin
David Crow8-Feb-05 2:56
David Crow8-Feb-05 2:56 
GeneralHitting allmenu items of an launched application Pin
Vaibhav Sanghavi7-Feb-05 23:03
Vaibhav Sanghavi7-Feb-05 23:03 
Hi All,

I have launched an application programmatically. I want to browse and hit all menu items of that application programmatically. How do I do that?

I have pointer to the mainframe window of that launched application. So from that I can get CMenu pointer to its menu using CWnd::GetMenu() fuction.

So now I have CMenu* which points to the menu of launched application. I am using CMenu::GetDefaultItem() to get the identifier and then hitting the menu using SendMessage but nothing is hapening. Any idea? Here is the code..

m_pMenu = m_pMainFrame->GetMenu(); // m_pMenu is of CMenu* type
UINT uItem = m_pMenu->GetDefaultItem(GMDI_GOINTOPOPUPS);
WPARAM wParam = MAKEWPARAM(0,uItem);
int iRet = m_pMainWnd->SendMessage(WM_COMMAND,wParam,NULL);

Do you see anything wrong in above code?

The other approach I adopted was as per below which just iterates though all menu items just to check that if I am able to access all menu items or not..

m_pMenu = m_pMainFrame->GetMenu();
UINT uItem = m_pMenu->GetMenuItemCount();
CString str;
for(int iPos=0; iPos < uItem; iPos++)
{
m_pMenu->GetMenuString(iPos,str,MF_BYCOMMAND);
}

Unfortunately this approach is not at all accurate. For instance If I launch Notepad.exe for then It gives me uItem = 4. But when I browse to get the menu string of each of them. It gives me blank as a string for Ipos= 0, gives Save when ipos=1, Save As for iPos= 2 and &Find for iPos = 3; This is an unexpected result because Save and Save As is part of File menu but Find is in the Edit menu.

Any clue?

--------------
Vaibhav...
QuestionHow to find that Machine is on LAN Pin
RuchirD7-Feb-05 22:19
RuchirD7-Feb-05 22:19 
AnswerRe: How to find that Machine is on LAN Pin
2249177-Feb-05 22:29
2249177-Feb-05 22:29 
GeneralRe: How to find that Machine is on LAN Pin
RuchirD8-Feb-05 17:11
RuchirD8-Feb-05 17:11 
GeneralToolTip in ATL Pin
mc.george7-Feb-05 22:10
mc.george7-Feb-05 22:10 
GeneralDisplay Full Item Text in CListCtrl Pin
aruc7-Feb-05 20:15
aruc7-Feb-05 20:15 
GeneralRe: Display Full Item Text in CListCtrl Pin
David Crow8-Feb-05 2:58
David Crow8-Feb-05 2:58 
GeneralRe: Display Full Item Text in CListCtrl Pin
Antony M Kancidrowski8-Feb-05 5:14
Antony M Kancidrowski8-Feb-05 5:14 
GeneralRe: Display Full Item Text in CListCtrl Pin
aruc8-Feb-05 22:24
aruc8-Feb-05 22:24 
Questionhow can I print a microsoft word file? Pin
Aqueel7-Feb-05 19:01
Aqueel7-Feb-05 19:01 
AnswerRe: how can I print a microsoft word file? Pin
2249177-Feb-05 21:04
2249177-Feb-05 21:04 
QuestionHow to measure number of cycles of a C code Pin
Tiza Naziri7-Feb-05 18:17
Tiza Naziri7-Feb-05 18:17 
AnswerRe: How to measure number of cycles of a C code Pin
ThatsAlok7-Feb-05 19:14
ThatsAlok7-Feb-05 19:14 
AnswerRe: How to measure number of cycles of a C code Pin
wb7-Feb-05 21:55
wb7-Feb-05 21:55 
AnswerRe: How to measure number of cycles of a C code Pin
Chris Losinger8-Feb-05 4:29
professionalChris Losinger8-Feb-05 4:29 
GeneralMCSD preparation!!!!!!!!!!!! Pin
URagavSouth7-Feb-05 18:12
URagavSouth7-Feb-05 18:12 
GeneralRe: MCSD preparation!!!!!!!!!!!! Pin
David Crow8-Feb-05 7:53
David Crow8-Feb-05 7:53 
GeneralRe: MCSD preparation!!!!!!!!!!!! Pin
URagavSouth8-Feb-05 17:24
URagavSouth8-Feb-05 17:24 

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.