Click here to Skip to main content
16,012,015 members

Comments by JOHN 602 (Top 29 by date)

JOHN 602 10-Oct-12 22:02pm View    
In that articles people say that There is no way to interact directly with the controls on the ribbon( I mean there is no way to change it's state).
But a reasonable question comes to my mind: Why is there an edit control if I can't change text in it ?? It's looks like foolishly.
I deem I've tried all the ways I found to get access to the ribbon control
CString pBoxOne;
GetParentFrame()->GetDlgItemText(ID_CR_EDIT,pBoxOne);//no use

What else I should try? I don't believe that there is no way to overcome this obstacle.
JOHN 602 10-Oct-12 21:29pm View    
Ive found that window class is Afx:RibbonBar:1370000:8:10003:10
If I try do

HWND hTray;

hTray = ::FindWindow(L"Afx:RibbonBar:1360000:8:10003:10", NULL);
if(hTray)
{

::SetDlgItemText(hTray,ID_CR_EDIT,L"mn,m");
}
hTray returns NULL;
JOHN 602 10-Oct-12 20:36pm View    
::SetDlgItemText(GetParent()->GetSafeHwnd(),ID_CR_EDIT,L"adasdaasd");
and ID_CR_EDIT is the same as it set in properties and of course it defined in Resource.h as #define ID_CR_EDIT 32784
Then I preset the text in properties window and try to read at runtime
CEdit* pBoxOne;
pBoxOne = (CEdit*) GetDlgItem(ID_CR_EDIT); in debug mode I see that is NULL
It returns NULL 'cause the prog begin searching the Edit control in same window. But what class handles Edit if it's on the ribbon panel. Looks like I should call it if I directly set the right class

I confused with all that It seems the simplest thing, but WTF ?
JOHN 602 9-Oct-12 13:54pm View    
yeah exactly
owing to my efforts to optimization I ain't see some evident things
tnx
JOHN 602 9-Oct-12 13:36pm View    
Do I need use ValidateRect() every time I need to redraw the window? Maybe there is another way once fix it and than sometime unfix it ? (in may way unfix picture when I need to load a new image)