|
If you have the HWND of the target window, you can send a message to it.
The problem I think you might be seeing is that timer messages are the lowest priority message in windows. You should set up a timer thread that pumps its own timer message (*not* WM_TIMER) if you want a reliable timer.
"...the staggering layers of obcenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi all,
I want to write a program that can run a cgi scrip from a domain in VC++.
And it communicate with domain through proxy.
If you have any relative information, please show me! Thank you very much!
Best regards,
BUNG
|
|
|
|
|
I'm porting Chris Maunder's CHyperLink class to WTL, but I've gotten stuck on one thing. The MFC original uses PreTranslateMessage() to relay messages to a tooltip. There is no PreTranslateMessage() in ATL, but since ATL message maps are just big switch statements, I ended up with this:
BEGIN_MSG_MAP(CHyperLink)
if ( m_ToolTip.IsWindow() )
{
m_ToolTip.RelayEvent(const_cast<LPMSG>(GetCurrentMessage()));
}
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
END_MSG_MAP()
This works but it's mighty ugly, so is there a better way of doing it?
--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
|
|
|
|
|
Actually its quite groovy...
PreTranslateMessage in MFC acts as a hook into the default message pump to alter how messages are dispatched.
so what you are doing here in WTL fits in well.
|
|
|
|
|
Hi.. just a simple question
How do i set the font when i want to display a text??
e.g. pDC->TextOut (0, 100, "HELLO WORLD");
how do i set the font of "hello world" to font-size 24 and Arial...
Thanks to ALL....
|
|
|
|
|
look up cdc - selectobject in the msdn help stuff
---
"every year we invent better idiot proof systems and every year they invent better idiots ... and the linux zealots still aren't being sterilized"
|
|
|
|
|
take a look at SelectObject
Nish
|
|
|
|
|
Use DrawText() instead, also create and select a CFont beforehand using CFont::CreatePointFont .
---
Simon
decided that his 'ironlung' nickname sounded kinda stupid, so he decided to use his real name
|
|
|
|
|
thanks........
|
|
|
|
|
I want to implement in the MeasureItem() function,but I found I can't
set the height base on the data of the item(because I call GetItemDataPtr(), it always returns NULL),what should I do?Thank you.
|
|
|
|
|
The problem is that during WM_MEASUREITEM processing there's no item data. If you have LBS_OWNERDRAWFIXED listbox, the message is sent when listbox is created - there are no items at this time. LBS_OWNERDRAWVARIABLE doesn't help either - it's sent when you add item, before your call to SetItemData.
You'll have to pre-calculate item height before calling AddString, store the value in the place from which MeasureItem can read, and use this value in MeasureItem.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
hi all, i need some help on program easy stuff. im trying to program tic tac toe but im stuck on trying to figure out how i can program a function to test to see if there's a winner yet...any suggestions on how to make a very simple function that can do this?
|
|
|
|
|
Well, what you need to do is set up a 2 dimensional array to hold your board, and then step through the possible sequences that indicate success. I guess you could do it in a one dimensional array of nine elements as well, but either way, you need to check each winning sequence to see if they all have the same value.
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
|
|
|
|
|
Keybd_event() is too weak for my needs. Certain programs it doesn't work with. I can't figure out syntax for using Sendinput(). All I want is example code that sends "H" to "Untitled - Notepad"...
UGH, I am 97% done with an application and I get stuck on this, I spent 10 hours already trying to figure it out. I even tried learning assembly to stuff the keyboard buffer, but I couldn't find any websites using the Alpha Assembler.
|
|
|
|
|
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
|
|
|
|