|
Try creating your popup window hidden and then show it with ShowWindow(SW_SHOWNOACTIVATE).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Damn, beat me to it!
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
Yepp *blows smoke off fingers*
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Life: great graphics, but the gameplay sux. <
|
|
|
|
|
Using the SW_SHOWNOACTIVATE flag when creating/showing your window should show it without your parent window losing focus.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
i have tried
Cdialog *d = new Cdialog(this);
d->Create(Cdialog::IDD, this);
d->ShowWindow(SW_SHOWNOACTIVATE);
and it stills do the same, it stills lose focus.
what i have notice is that using disable property of the dialog does not lose focus in the parent window but it of course disable the child window
|
|
|
|
|
I need to write an application that doesnt allow some specific websites to be opened. I think the solution is socket programming on the port 8080 but not sure about the details.
Am I wrong about the solution?
What is the solution for this?
Thanks a lot.
Mike
|
|
|
|
|
ArashFar wrote: What is the solution for this?
I don't know, but a search such as this might give you some ideas.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks but as you see the results are just bunch of companies with a proxy application to sell
Arash
|
|
|
|
|
I realize that, but sometimes even looking from the outside-in, you can glean helpful hints as to how an application works.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
DavidCrow wrote: sometimes even looking from the outside-in, you can glean helpful hints as to how an application works.
Or you could just go read something like this[^]
|
|
|
|
|
Thanks!
That is a great site
Arash
|
|
|
|
|
How can I tell if the registry key doesn't exit?
GetProfileInt(strSection, "Variable",0);
Well, this will return 0 if Variable doesn't exist by default. How can I know if "Variable" doesn't even exist, becasue I would like to do something else based on that.
Thanks
sft
|
|
|
|
|
Software2007 wrote: How can I tell if the registry key doesn't exit?
By calling RegQueryValueEx() .
Software2007 wrote: GetProfileInt(strSection, "Variable",0);
This function is intended for .ini files.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks. Am I understanding this correctly?
RegQueryValueEx():Retrieves the type and data for the specified value name associated with an open registry key.
This seems to retrieve the type of "Variable" in my example, I would like to know if "Variable" exists in the registry before I do anything to it.
Thanks
sft
|
|
|
|
|
Software2007 wrote: Am I understanding this correctly?
Software2007 wrote: This seems to retrieve the type of "Variable" in my example, I would like to know if "Variable" exists in the registry before I do anything to it.
I believe your capacity to understand is like quadrupled if you actually read the documentation
If the lpValueName registry value does not exist, the function returns ERROR_FILE_NOT_FOUND.
|
|
|
|
|
Thanks. I feel smarter already.
sft
|
|
|
|
|
The above wouldn't work for what I need. RegOpenKeyEx did.
sft
|
|
|
|
|
Hi all,
I've got a small problem with derived classes and a wrapper class. To show you what my problem is, I write down some code. Here's what I do now:
class Base
{
doFunc1();
virtual doFunc2();
}
class Der1 : public Base
{
doFunc2();
}
class Der2 : public Base
{
doFunc2();
}
class Wrap
{
Der1 *d1;
Der2 *d2;
doFunc1();
doFunc2();
}
Wrap::doFunc1()
{
if(somecondition)
d1->doFunc1();
else
d2->doFunc1();
}
Wrap::doFunc2()
{
if(somecondition)
d1->doFunc2();
else
d2->doFunc2();
}
From my program I can call:
Wrap::doFunc1();
Now I want to remove the Wrapper calls and replace them with function pointers like this:
class Wrap
{
Der1 *d1;
Der2 *d2;
(*doFunc1)();
(*doFunc2)();
}
Wrap::Wrap
{
if(somecondition)
this->doFunc1 = &Der1::doFunc1;// causes C2440
this->doFunc2 = &Der1::doFunc2;// causes C2440
else
this->doFunc1 = &Der1::doFunc1;// causes C2440
this->doFunc2 = &Der1::doFunc2;// causes C2440
}
From my program I would like to call:
Wrap::doFunc1();
The line this->doFunc1 = ... causes C2440: type cast: cannot convert from (__thiscall Der1::*)() to (__cdecl*)().
I know that class members are not the same as normal c-functions, this causes the __thiscall to __cdecl error, but I thought that there is some trick to get it to work.
Any ideas?
jung-kreidler
|
|
|
|
|
Look at the pointer-to-member operators .* and ->*
«_Superman_»
|
|
|
|
|
Does not help, since my Wrapper is a different class. Pointer-to-member works only inside a class, e.g. Testpm: void (Testpm::*pmfn)() = &Testpm::m_func1;. I need e.g. void (Wrap::*doFunc1)() = &Der1::doFunc1. Using it on different classes causes C2440
Thanks for the answer.
|
|
|
|
|
I have a dialog that is a keypad. It is called from a Login dialog. The problem is that if a mouse button is clicked outside the keypad dialog, the keypad becomes unusable. I'm thinking that this dialog should be modal. How to accomplish setting the keypad dialog as modal in the following code snippet
void CLogin::OnBnEnterId()
{
// TODO: Add your control notification handler code here
// have to place coords here, since initialization takes place later
winInfo.popup_X = 395;
winInfo.popup_Y = 50;
CKeypad kp(mainFramePtr->wndPtr, winInfo);
int intValue = 0;
if (kp.Get_Integer("Enter ID Number", 0, 99999, &intValue))
{
char temp[6];
char temp1[6];
.
.
.
.
The keypad closes on button that returns IDOK.
Thanks for your help.
AF Pilot
|
|
|
|
|
See here.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi All,
I want to change the width of dialog box as per the length of static text control on it,
I tried like this,
CRect rect;
GetWindowRect(rect);
CDC* pDC= GetDC();
CSize size = pDC->GetTextExtent(m_strTitle); // m_strTitle static text value variable
MoveWindow(rect.left,rect.top,size.cx,25);
but problem is that it is missing some characters from end,
about one char per 10 chars,
so for one whole big line almost 10-15 chars are missing.
what could be the posible reasons?
Thanx in advance.
|
|
|
|
|
Are you sure that DC has the same font selected into it as the static text control?
Also, you're not taking the window frame into account (you need to send WM_NCCALCSIZE[^] to the window to get the non-client size from the client size).
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Urgent?
You, Sam, are crazy!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|