|
WindowFromPoint() will find any visible window (child or not) that has the specified point in it. The only restrictions are that the window must be visible and enabled, and it will not return static text windows (it returns the parent of the static text window).
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
CWnd is a child window of the CDialog and the controls are the child window of the CDialog too. But CWnd hides some controls. Therefore control becomes invisible under CWnd and for WindowFromPoint()
Best regards,
Eugene Pustovoyt
|
|
|
|
|
OK. Well in that case use EnumChildWindows() , GetClientRect() and CRect::PtInRect() and check them all manually.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ok. Thank you
Best regards,
Eugene Pustovoyt
|
|
|
|
|
You're welcome
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
hi,
I am trying to import a tab delimited text file into an MS Access database using transferText function.This transferText function needs the import Specification name for creating the table.It specifies the format ,number of columns ,columnnames etc.We can do it manually in MS Access using import wizard's Advanced button.But in my project requirements are such that the user won't be manually creating the specification.
I ask help of all the experts to help me create the specification programmatically.It's Quite urgent.
Thanks and regards.
|
|
|
|
|
Hi !
I was wondering (and couldn't find any answer in my C++ book) if, when using a struct, it is possible in C++ to do something simliar as :
with MyOwnStruct
.Name="John";
.Age=30;
.Height=180;
Thank you for your help !
Jerome
|
|
|
|
|
Jerome Conus wrote:
possible in C++ to do something simliar as
snip
Short answer: No.
Longer answer:
In C++ you have the concept of encapsulation at hand, why not use it?
class MyOwnClass
{
public:
typedef std::string string;
MyOwnClass(string name, unsigned int age, double height)
: m_name(name), m_age(age), m_height(height)
{
}
private:
string m_name;
unsigned int m_age;
double m_height;
};
|
|
|
|
|
It is a bit twisted but you can do this if you really want to :
class CPerson
{
private:
const char * Name;
int Age;
int Height;
public:
virtual CPerson & SetName(const char *name) { Name = name; return *this; }
virtual CPerson & SetHeight(int height) { Height = height; return *this; }
virtual CPerson & SetAge(int age) { Age = age; return *this; }
};
...
CPerson person;
person.SetName( "Bob" )
.SetAge( 42 )
.SetHeight( 69 );
The Ten Commandments For C Programmers
|
|
|
|
|
Hi,
i have tried changing the the color of the button,using OnCtlColor and many otherways,but it doesn't work..
How to change the color of the button in SDI application?
adieu
ajit
|
|
|
|
|
OnCtlColor havn't effect on the button. You must create owner-draw button to change bk color. Or to use a cool CButtonST class by Davide Calabro.
Best regards,
Eugene Pustovoyt
|
|
|
|
|
can u please send me the link for the CButtonST
|
|
|
|
|
I'm sorry
It's here
Best regards,
Eugene Pustovoyt
|
|
|
|
|
I would like to add functionality to an MFC application where information is e-mailed to a pre-specified address. It would be easy enough to use the existing e-mail software in the computer, but I am not looking to do this, as I don't necessarily want the user to know the e-mail was being sent. I would like some direction on sending an e-mail message out of an MFC application, and doing so without alerting the user to it being sent. I would appreciate any help I can get! Thanks so much ;)
(I thought I'd better note that I am not intending to send "stealth" e-mails for malicious purposes. Believe it or not, there really is an application I am working on which requires this.)
Douglas A. Wright
dawrigh3@kent.edu
|
|
|
|
|
You can use SMTP protocol and sockets its easy enought.
|
|
|
|
|
Hi all,
I've made a translucent window in win2k/sp3/vc++6/sp5
using WS_EX_LAYERED and SetLayeredWindowAttributes(). When
I then right click the window body and make it popup a
context menu, I see the displaying of the selected menu
item terribly disturb by that (background) layered window.
It seems the layered window gets a higher z-order and then
tries to show above the menu.
Try this for a clear idea of it:
------------------------------------
1. goto: http://www.codeproject.com/dialog/smoothalpha.asp?target=setlayeredwindowattributes
2. run Kirill's demo and make the window semitransparent
3. right click the edit control
4. move the mouse pointer across the shortcut menu boarder(and select the topmost item - Undo(U))
5. you'll see what happens to the selected part of the menu
------------------------------------
Anyone know why this happens and how to correct it?
Thanks
|
|
|
|
|
hi!,
does anyone a sample code of File system api hook for win9x and win nt/2k.
for win9x we need to write a vxd and for win nt/2k we should write a file system driver.
i need to hook the createfile(),writefile() etc.. calls.
thanks
anshu
|
|
|
|
|
The mechanisms are completely different for the 16/32-bit shells (9x, ME) than for NT kernel based OSes.
But if you only need to hook Win32 API calls, it'd be much, much, easier to use "injection" and IAT patching. I believe there are examples of this at this site. If not, try codeguru or google and you'll find how to do it.
|
|
|
|
|
ya i have read about injecting using IAT,its also called api hijacking,i got the article on this site itself.
as you said those are completely different mechanisms for doing the things in win9x/me and ntbased system.
we have to write a vxd for win9x/me and filesystem driver for ntbased systems.
i wanted to do things using these mechanisms.
if u can recommend any good books for the same then it would be helpful.
thank you
anshu
|
|
|
|
|
|
anshumanshinde wrote:
we have to write a vxd for win9x/me and filesystem driver for ntbased systems(emphasis added)
OK, that concludes it. You *are* stuck between a rock and a hard place. You will have to learn Win9x VxD programming. You will have to learn NT kernel mode programming. You will have to learn filesystem filter drivers, the subtle but often crashing (BSOD-style) difference in the driver model between e.g. NT4 and NT5, the addition of IRP_Xxxx "messages", the addition of ... if you are unlucky even the added power management in NT5+. Just to mention a few of the problems you are facing.
I wish you luck. This is an effort I'd myself feel as a refreshing challenge to undertake!
If I knew less than I do, I'd really recommend the (AFAIK) only commercial entity that *do* know these things and can provide both help and education: OSR. Please note I know close to nothing about that company and have no interests in it - it just happens to be the only entity I know about that actually *can* provide help in these areas.
Again: ++luck;
/Mike
|
|
|
|
|
hi ,
am trying to Draw a rect on top of the text. It is not working . pls see the code
CFont font;
CSize sz;
CBrush gBrush = RGB(10,255,10);
CBrush bBrush = RGB(0,0,0);
CString str=_T("HELLO WORLD");
VERIFY(font.CreateFont(
25, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial Narrow")); // lpszFacename
pDC ->SelectObject(font);
pDC->SelectObject(bBrush);
pDC->TextOut(5, 5, str);
pDC->SelectObject(gBrush);
sz = pDC->GetTextExtent(str);
pDC->Rectangle(5,5,sz.cx+5,sz.cy+5);
|
|
|
|
|
CDC::Rectangle() uses the current pen, not a brush. Create a new pen first, select it into the DC, and then try drawing it.
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
hi Thanks for the reply...I tried that way also, pls see the code, but not working.
Thanks very much
CFont font,font2;
CSize sz;
int x1=0,y1=0,x2=0,y2=0;
CString str=_T("HELLO WORLD");
VERIFY(font.CreateFont(
25, // nHeight
0, // nWidth
0, // nEscapement
0, // nOrientation
FW_NORMAL, // nWeight
FALSE, // bItalic
FALSE, // bUnderline
0, // cStrikeOut
ANSI_CHARSET, // nCharSet
OUT_DEFAULT_PRECIS, // nOutPrecision
CLIP_DEFAULT_PRECIS, // nClipPrecision
DEFAULT_QUALITY, // nQuality
DEFAULT_PITCH | FF_SWISS, // nPitchAndFamily
"Arial Narrow")); // lpszFacename
pDC ->SelectObject(font);
sz = pDC->GetTextExtent(str);
CPen myPen(PS_SOLID,1,RGB(10,255,10));
pDC->SelectObject(&myPen);
pDC->TextOut(5, 5, str);
pDC->Rectangle(5,5,sz.cx+5,sz.cy+5);
|
|
|
|
|
1) What is the value of sz? Is it returning a valid size?
2) What is Rectangle() returning? It should return TRUE if successful.
Dave
http://www.cloudsofheaven.org
|
|
|
|