|
I am looking for the text in the main edit area. So, I am enumerating all child windows and get the text in it.
However, this approach does not work with complex programs, like MS Word and VS. I get the text of the toolbars and combo boxes, but I cannot get the text of the main writing area.
Mustafa Demirhan
|
|
|
|
|
Ah, you're enumerating CHILD windows. I'd suggest the relationship in a more complex app is a little more, well, complex, than one main window with a couple of direct children, hence your problem. Try doing it recursively and see how you go.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
A program like MS Word or VS does not use standard windows components (ie edit box, listbox, etc.) to display text. Standard windows components do not handle custom drawing such as tables, embeded graphics etc. If you want to get the text from a program such as MS Word then you'll have to use OLE Automation.
Todd Smith
|
|
|
|
|
I can't seem to draw a combobox in a listviews subitem. The combobox sizes funny.
The width and position end up correct but it ends up way to high.
I get the rectangle of the subitem just fine
GetListCtrl().GetSubItemRect(pNMLV->iItem,1,LVIR_LABEL,itemRect);
then I create the combobox with the rectangle info...
CPropListCombo *pPropCombo = new CPropListCombo;
pPropCombo->Create( WS_CHILD | WS_VISIBLE | CBS_DROPDOWNLIST | WS_CLIPCHILDREN,itemRect, this, 200 );
pPropCombo->ShowWindow(SW_SHOW);
correct position, and width but it's height is way to big....maybe double the size of what's in the CRect. I tried subtracting a large amount from the itemRect.bottom but it made no difference.
I do the SAME thing with a CBotton and a CEdit and it works fine....there isn't some minimum size for a combobox is there?? This is just CComboBox
thanks
mike
|
|
|
|
|
I think you have to get a pointer to the edit window of the combobox instead of the drop-down window. You're resizing the wrong thing.
"...the staggering layers of obcenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I am going bonkers. I received a handful of responses which I printed out, but I still can't get
this to work.
I call a modal property sheet with two (2) property pages. I use the following code:
CPropertySheet sheet("PropertySheet");
CPropertyPage1 Page1;
CPropertyPage2 Page2;
sheet.AddPage(&Page1);
sheet.AddPage(&Page2);
sheet.SetActivePage(1);
sheet.SetActivePage(0);
if (sheet.DoModal() == ID_OK) { }
I have single and multiline edit boxes, check boxes, and a CListBox in the property pages. If I
type the following before I call DoModal():
Page1.m_edit1 = "hello";
I have no errors. For the single line edit box, this text appears. If I try putting text in a multiline
edit box or a simple combobox by typing say:
Page1.m_combo.SetCurSel(3);
I get a debug assertion error because m_combo is null or the multiline edit box is null.
I tried typing something like:
CWnd *pWnd;
pWnd->GetDlgItem();
then using SetWindowText(), but this doesn't work either.
SO MY QUESTION IS: How can I fill edit controls,
like a multiline edit box, a combo box, or
list box, in a property page before
calling DoModal()?????
Please, please, any response any one can give me will be greatly appreciated.
Sincerely,
Danielle (an overworked graduate student)
|
|
|
|
|
Page1.m_edit1 = "hello";
this fails for a multi-line edit? assuming m_edit1 is a CString that you've DDX'd to an actual edit control, it should just work.
-c
Smaller Animals Software, Inc.
http://www.smalleranimals.com
|
|
|
|
|
You can't, not if those controls belong to and are instantiated by the dialog box you are calling the domoal for. You cannot use a window *as* a window before the window is instantianted. You *can* preload values before the domodal and than, in the initinstance method, for example, load the instantiated controls with those values.
"But, daddy, that was back in the hippie ages..." My twelve year old son - winning the argument.
"Stan, you are an intelligent guy who responds in meaningful ways" Paul Watson 16/10/01
|
|
|
|
|
Yikes! Sorry. Mike's correct. OnInitDialog() not initinstance.
"But, daddy, that was back in the hippie ages..." My twelve year old son - winning the argument.
"Stan, you are an intelligent guy who responds in meaningful ways" Paul Watson 16/10/01
|
|
|
|
|
How can I fill edit controls, like a multiline edit box, a combo box, or list box, in a property page before calling DoModal()?
You can't, because the control windows haven't been created yet. The correct place to set up controls is OnInitDialog(). At that point, the windows have been created but not yet shown.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
Hi,
How can I get the position of the cursor in a console app?
I use 'SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), &coord)' to set the position, but there seems to be no 'GetConsoleCursorPosition' function.
Thanks in advance!
Erik
|
|
|
|
|
take a look at GetConsoleScreenBufferInfo
Nish
|
|
|
|
|
|
I want to print a web page in my program, how should I do?
|
|
|
|
|
Try using the Internet Explorer control in ur application.
|
|
|
|
|
Do you already have a web browser control? If you do you can use the ExecWB method.
|
|
|
|
|
and I have inserted a web browser ActiveX control(but not htmlview) in my program.thanks again.
|
|
|
|
|
Hi all,
I have a friend that know Java ...
I heard that he can write program with the Internet Explorer view ...
I mean he can write program without using any dialog or ... inside the Internet Explorer window, first i wanna know is it right ?
and in last HOW ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
he probably meant he wrote an applet
Nish
|
|
|
|
|
Can i write program like this Java program ?(with MFC)
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Guess you could try writing an ActiveX control
Or perhaps you might want to look into HTA
Nish
|
|
|
|
|
Do you mean an HTA, Hypertext Application? You can write an application that makes use of IE without displaying the IE toolbar, address bar, etc. If you are not familiar with this try changing the extention of a page from htm, or html, to hta and open it.
|
|
|
|
|
I searched this forum and found articles on taking application to full scrren.
I applied the way MSDN article ID:Q164162 specified. The problem I get a border when the window goes fullscreen. Is there a way to remove that border.
Thanks in advance.
|
|
|
|
|
Resize the window so the border is outside it. You can use GetSystemMetrics (SM_CXBORDER, SM_CYBORDER and SM_CYCAPTION to find out the size of those parts of the window you want to hide.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
- TLS means thread local storage. MSDN says, we can use Dll to initialize TLS.
- I am puzzled at this point. I think TLS is a part of thread and Dll is not a part of thread. Why we should use Dll to initialize the TLS?
Do we use TLS in our Dll?
- I am a beginner of Dll and I have never used TLs before. So my question maybe stupid.
- Can you help? Or show me an example?
Regards,
Maer
|
|
|
|