|
My intension is I would like to handle Escape button and Enter key in different ways.
Thanks for giving reply
Nice talking to you.
|
|
|
|
|
G Haranadh wrote: My application is simple dialog based application. I derived the OnOk(), OnCancel() functions in CMyDialog class. I wrote nothing in those functions. But after run this application I could not able to close the dialog. Why it is happeneing so. How can I solve this problem? Here my view is not to close the dialog when I pressed the enter button or escape button. How it is possiable in different ways. Please help me in this.
See :
Dialog windows and WM_CLOSE[^]
|
|
|
|
|
Thank you for helping us through codeproject. Thanks alot. Have a nice day I am very glad to talk to you
Nice talking to you.
|
|
|
|
|
Hi,
When I used Visual Studio 6, life was easy, I would edit the main application icon and when I created a desktop shortcut for it, there is was. The same for the 16X16 icon, when I created it, you could see it in the windows explorer.
However, when working with Visual studio .NET 2003, my Application's Icon will not change and stays the default MFC icon.
Any help will be great.
shay
|
|
|
|
|
in fact, a .ico file contains several icons, varying from the size and/or the number of colors.
when you edit an icon with the icon editor within Visual Studio, you should verify that all the devices (that's how they're called) are like you want...
(search the menus for that ; i don't remember exactly where).
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
Well, you set it from the Image menu, I just found out.
Thanks.
|
|
|
|
|
Hello,
I don't know why this is proving difficult. It is obviously a very common task. I have an SDI application that is hosting an ActiveX control. The ActiveX control has some events that it fires. I want to handle these events in the host application. I cannot figure out how to hook it up.
The ActiveX control is not added at design time. It is dynamically created.
Thoughts?
Thanks!
-Ian
|
|
|
|
|
Ian Bowler wrote: The ActiveX control is not added at design time. It is dynamically created.
You still have to implement the event sink which means that you need to know how the sink interface is defined.
The easiest way is to add the control to the project at design time and use ClassWizard to generate the event sink.
When you 'hook it up' you have to use IConnectionPointContainer and IConnectionPoint interfaces and in the end call IConnectionPoint::Advise and provide an interface pointer to the sink.
--
Roger
It's supposed to be hard, otherwise anybody could do it!
|
|
|
|
|
Thanks. I'll look into this method.
still... this is extremely common right? It seems like there should be an easier way. Something through class wizard..?
|
|
|
|
|
I want to create a Window witch is always on bottom z order, in fact this window is my "desktop" with some "buttons" , and these buttons launch some other applications. But the "desktop window" can hide the launched applications
Some body could help me
Thanks a lot in advance
Christian
|
|
|
|
|
Look at the Windows MFC site for the description of the SetWindowPos() function, you can understand it from there, I am sure.
|
|
|
|
|
How do you change the little icon picture in the title bar of a CDialog window?
Heather
|
|
|
|
|
you have to change the IDR_MAINFRAME resource with the new icon (still in OnInitDialog())...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
SetIcon()
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
True, a secondary thread might not even have a message pump.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
How do you dynamically change the caption title in .NET for a CDialog window?
Heather Heiman
|
|
|
|
|
CDialog is not a .NET class, but a MFC one.
i so consider you're using MFC.
you simply have to do this :
this->SetWindowText("new caption");
in a function of your dialog class...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
I tried that line of code, but it doesn't seem to do anything. I even called UpdateData to see if that would work. I'm calling SetWindowText in OnInitDialog. Is there another place I should call it?
Heather
|
|
|
|
|
there's no need to call UpdateData() if you use pointer (here, this ).
you might be doing something wrong because it works fine for me (according you call it into OnInitDialog(), not into the dialog constructor)...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
I got it to work. Thanks.
Heather
|
|
|
|
|
and what was the missing point ??
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
I had the SetWindowText call in the wrong function. I put it in OnInitDialog and it worked fine.
Heather
|
|
|
|
|
I have a windows message problem that has haunted me for a long time.
Suppose one application has two thread. Thread A "sends" and "posts" message
to a window handle in thread B.
Thread A
{
LOOP{
...
SendMessage(m_hwnd, msg1);
...
PostMessage(m_hwnd, msg2);
...
}
}
in winproc of Thread B:
Winproc
{
case (msg1): do something
...
case (msg2): do something
...
}
my question is: if Thread B is processing msg2, and Thread A are going to
send msg1 , Thread A will wait until Thread B finishes processing msg2??
|
|
|
|
|
The very definition of SendMessage() says that control does not return until the window procedure (the one in thread B) has processed the message. If this is a problem, use SendMessageTimeout() instead.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hi David,does that mean: Thread B will always process msg1 then msg2 ,again and again? it could not process two continous msg2?? However, I found in my project,
this situation happens, but not often!
-- modified at 11:54 Wednesday 7th December, 2005
|
|
|
|