|
As it's a W98 on function, it won't work unless you have a Microsoft SDK installed.
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
|
|
|
|
|
I use windows 98, so would I be wrong to assume that its already instealled... How can I check if its in or not?
|
|
|
|
|
Totally wrong. The SDK is released four times a year by Microsoft. Just search the site for Platform SDK. It's up to date headers and library files, etc. for developers, there is no need for an end user to have them and they do not ship with any OS.
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
|
|
|
|
|
////////////////////////////////////////////////////////////
// All,
// I would appreciate any feedback on this.
// Is this the best way to do this?
// Thanks,
// Rich
////////////////////////////////////////////////////////////
BSTR bstrProperty;
STDMETHODIMP MyObject::get_Property(BSTR *pVal)
{
// According to KB article, I need
// return a copy.
*pVal = SysAllocString(bstrProperty);
return S_OK;
}
STDMETHODIMP MyObject::put_Property(BSTR newVal)
{
// According to KB article, I need
// my own copy to use and later free.
bstrProperty = SysAllocString(newVal);
return S_OK;
}
|
|
|
|
|
You also need to free the BSTRs before storing new values in them. So in get_Property:
SysFreeString ( *pVal );
And in put_Property:
SysFreeString ( bstrProperty );
I believe it's ok to pass NULL to SysFreeString(), but it wouldn't hurt to put in some standard pointer error-checking as well.
--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
|
|
|
|
|
Mike,
I appreciated your response. I'll look into your suggestions.
Thanks,
Rich
|
|
|
|
|
Does anyone know how to get access to the time zone data that the clock/calender uses for the combobox and filling the TIME_ZONE_INFORMATION structure.
Happy programming!!
|
|
|
|
|
Check out the KB article "INFO: Where the Time Zone Information Is Stored" (MS's site looks to be down ATM so I don't have the article number). It says --
The time zone information is stored at the following locations:
On Windows NT:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones
On Windows 9x:
HKEY_LOCAL_MACHINE\Software\\Microsoft\Windows\CurrentVersion\Time Zones
--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
|
|
|
|
|
The IE6 and the Windows XP use this, how can i do this?;P
|
|
|
|
|
Hi there,
I am trying to find a text in a window. For example, I am trying to find if an open Notepad contains a specific text or not. This works for simple windows, like Notepad and Message boxes. However, when I try to find a text in Internet Explorer, Visual Studio or MS Word, it does not work.
How can I find a text in a window? What's wrong with the following code?
Thank you very much for any helps in advance.
<br />
bool FindText (HWND hwnd)<br />
{<br />
if (pWndOp == NULL)<br />
return false;<br />
<br />
bool bResult = false;<br />
LPARAM lParam = (LPARAM)(&bResult);<br />
EnumChildWindows (hwnd, (WNDENUMPROC)EnumChildProc, lParam);<br />
<br />
return bResult;<br />
}<br />
<br />
BOOL CALLBACK EnumChildProc(HWND hwnd, LPARAM lParam)<br />
{<br />
if (hwnd)<br />
{<br />
TCHAR szTemp [1024] = {_T('\0')};<br />
<br />
SendMessage (hwnd, WM_GETTEXT, sizeof(szTemp) / sizeof(TCHAR), (LPARAM)szTemp);<br />
<br />
CString sText (szTemp);<br />
if(!sText.IsEmpty ())<br />
{<br />
if ( sText.Find (pWndOp->m_sText, 0) != -1)<br />
{<br />
*((bool*)lParam) = true;<br />
return FALSE;<br />
}<br />
}<br />
return TRUE;<br />
}<br />
else<br />
return FALSE;<br />
}<br />
<br />
Mustafa Demirhan
|
|
|
|
|
You're looking for text in the window title bar, or in the main edit area ? I would have thought that doing this for a title bar would work for any program, but if it's the latter, then you're obviously going to need to get a handle on the child window that is the actual edit area, and check that.
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
|
|
|
|
|
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?
|
|
|
|
|