|
You should be able to shrink app to:
Y = GetSystemMetrics(SM_CYCAPTION)+GetSystemMetrics(SM_CYDLGFRAME);
X = n*GetSystemMetrics(SM_CYDLGFRAME);
Boyond that requires patching OnNcCalcSize
|
|
|
|
|
Hi
If I have a number of radi buttons on a dialog that are grouped together clicking on one unclicks the others. Using SetCheck for a button however from in the code leaves the others unchanged ie checked if they were the previously selected button.
Is there a way to easily achieve the same functionality of clicking from within the code ?
|
|
|
|
|
Perhaps calling CWnd's CheckRadioButton helps?
|
|
|
|
|
How can I replace CSpinButton inside TabCtrl????
Cann't use "PreSubclassWindow()" as control may not be created at that time?
May be someone has ideas how to detect when CTabCtrl created Spin?
Thanks,
Brian
|
|
|
|
|
The spin button sends a WM_PARENTNOTIFY msg to the tab control when it's created. If the low order word of wParam is WM_CREATE then get the child control's class name (lParam is a pointer to the child's HWND). If the class name is "msctls_updown32" then you hit the jackpot
|
|
|
|
|
Thanks, worked like a charm....
One more question... If I want to hide Spin, what would be the best way to do this...
|
|
|
|
|
subclass the spin control and then on WM_WINDOWPOSCHANGING set the flags like this:
((LPWINDOWPOS)lParam)->flags &= ~SWP_SHOWWINDOW;
((LPWINDOWPOS)lParam)->flags |= SWP_HIDEWINDOW;
|
|
|
|
|
Hi
I'm trying to do some work with AVI files using Visual C++ 5.0 while running Win XP. I've been having a lot of problem and a few posts I've seen suggest that I'll need to upgrade to version 6.0 to use some of the features in XP for AVI's.
Does anyone know if this is actually the case?
Confused Kenny
|
|
|
|
|
Is it possible to block packets(Forcing them not to reach their destination)using Winsock API. Plz provide relevent sites containing the help and the source codes.
Reply me soon
|
|
|
|
|
Hello all,
In my project I want to scroll a web page pixel by pixel.
currently i do :
<code>IDispatch *pDisp = GetHtmlDocument();
IHTMLDocument2 *pDocument = NULL;
pDisp->QueryInterface( IID_IHTMLDocument2, ( void** )&pDocument );
IHTMLElement* pBody = NULL;
pDocument->get_body (&pBody );
IHTMLElement2* pBody2 = NULL;
pBody->QueryInterface(IID_IHTMLElement2,reinterpret_cast<void**>(&pBody2));
long ScrollX = 0;
long ScrollY = 0;
long ScrollHeight = 0;
long ScrollWidth = 0;
pBody2->get_scrollHeight(&ScrollHeight);
pBody2->get_scrollWidth(&ScrollWidth);
while(1)
{
..
..
if (ScrollX == ScrollWidth)
{
ScrollX = -1;
ScrollY++;
}
pWindow->scrollTo(ScrollX++,ScrollY);
}</code>
at the beginning it is fast but progressively it is increasingly slow !
, you know how scroll document fastest ?;)
|
|
|
|
|
NetShareEnum fails on calls to machines that are not members of the last domain enumerated by NetServerEnum...
For example, I have a treeview that behaves much like Windows Explorer... the treeview's constructor calls NetServerEnum, which enumerates the 2 domains on my network, and displays each as a node in the treeview...
clicking on a domain node calls NetServerEnum again to enumerate all the machines on that domain... so far so good..
clicking on a machine calls NetShareEnum to enumerate all shared resources on that machine...
My problem is that NetShareEnum only succeeds for machines on the second (last) domain...if I click on a machine under the first domain, I get a return val of 53 - "network path not found"
There is no provision in NetShareEnum to specify a domain, so I'm wondering if I have to call NetServerEnum (just before NetShareEnum) for the desired domain, so I have the right context...???
thanks for any help.
|
|
|
|
|
i want adjust a dialog and his child dialog position,to make them match.
thanks!
|
|
|
|
|
See CDialog::PreCreateWindow() and CREATESTRUCT.
Jon
#include <beer.h>
|
|
|
|
|
You can use SetWindowPos to move the child dialog. I usually put a (non visible)
static control on the parent dialog to be replaced / superimposed by the child
dialog. Roughly:
class CParentDlg
{
...
CChildDialog m_Child;
...
};
BOOL CParentDlg::OnInitDialog ()
{
...
CRect rcStatic, rcChild;
GetDlgItem (IDS_PLACEHOLDER)->GetWindowRect (&rcStatic);
ScreenToClient (&rcStatic);
m_Child.Create (...);
m_Child.GetWindowRect (&rcChild);
ScreenToClient (&rcChild);
m_Child.SetWindowPos (GetDlgItem (IDS_PLACEHOLDER),
rcStatic.left + (rcStatic.Width () - rcChild.Width ())/2,
rcStatic.top + (rcStatic.Height () - rcChild.Height ())/2,
0,0, SWP_NOSIZE);
....
}
I hope that helps. The bit of maths makes the child dialog centre at the same
point as the static centre. Another thing to watch is to set the "Control Parent"
style, so you can tab "through" the child dialog.
Iain.
|
|
|
|
|
I have 2 file list window which are "1FileListCtrl" and "2FileListCtrl"
and I have 2 radio. If I check radio one, I expect 2FileListCtrl window is disable but it is not disable. Do you know how to solve my problem?
These below is my code (when I check radio one)
void CTestView::OnKeyfileRadio() <br />
{<br />
UpdateData(TRUE);<br />
if (m_keySrc == 0) {<br />
1FileListCtrl.EnableWindow(TRUE);<br />
2FileListCtrl.EnableWindow(FALSE);<br />
}<br />
UpdateData(FALSE);<br />
}
This is my picture problem
http://www.geocities.com/foruonlyna/1.JPG
|
|
|
|
|
You code seems to be ok. So you could check if your call to UpdateData(TRUE) is succesfull. And are you sure that 2FileListCtrl is connected to the window you expect it to be? Or do you have another handler for your 2nd radio box, which possibly re-enables your window?
|
|
|
|
|
m_keySrc is your problem. solution:
ooosawaddee3 wrote:
//if (m_keySrc == 0) {
1FileListCtrl.EnableWindow(TRUE);
2FileListCtrl.EnableWindow(FALSE);
//}
|
|
|
|
|
Lazy programmer is looking for way to automate removal of unused code from my MFC VC++ files. Not looking for code beautifier / formater - my code is beyond help here! Willing to build my own but have a little experience in this field. Any constructive suggestions welcomed. Thanks
Vaclav
|
|
|
|
|
Numega BoundChecker comes with "TrueCoverage" and TrueTime.
Both tools pretty good at detecting possibly dead code....
As far as really automated way I don't think so.... Function may be called on some very rare circumstances.
Unless you have very trivial case when function never called from anywhrere, then may be U can use VC parser to parse source, load functions into own hash table, and exclude all messages...
|
|
|
|
|
Hi All,
I wanted to make GUI windows for a console project written that is in C. So I created a simple MFC Dialog Box Application and included all the console project's source files, header files and the library files in to the workspace and called the main(...) function of the console project on the click of a button by passing the command line arguments with it.
The actual C console project, when run in Microsoft Development Editor in both debug as well as release mode, runs perfectly.
If I run the MFC project by pressing F5 in debug mode, it runs well but causes problem when i run the debug EXE from windows explorer. It also crashes when i run it in release mode either by pressing F5, Ctrl F5 or directly run the release EXE from windows explorer.
The problem when i debugged the release mode was that at a certain point, one malloc was returning NULL despite the fact that I have enough memory (256MB) with me.
The malloc is being called from the well running C project file. The same malloc call returns good values for 6 times but returns NULL for the seventh call when i try to allocate just 13 bytes. The problem is not the memory shortage but as i think may be the linking of the C project in MFC environment.
Any help is welcomed...
Deepak Gupta.
Have a Good Day!!!
|
|
|
|
|
Dear friends,
I developed an out-of-proc COM component i.e it is an exe that exposes interface. The clients talk with this component via the interfaces it expose.
Now i want this out-of-proc server to be able to call back its client, i.e i want to fire events from this component. Can any one tell me that how can i do so?? I would be glad if you point me out some sample application.
|
|
|
|
|
i need a functiont that will dial a telephone number or IP address, but i need it to be simple like some kind of DOS command or something like that, my other question is what code can i include to make my password apear like "***" instead of 123, thanks
|
|
|
|
|
There is a check box named 'Password' in edit control, which would help you do that. my previous reply was for c#, sorry
Cheers,
Kannan
|
|
|
|
|
Use RasDial() for dialing a telephone number.
A. Riazi
|
|
|
|
|
let say i had created a thread by
hThread = CreateThread(
NULL, // default security attributes
0, // use default stack size
ThreadFunc, // thread function
&lpVoid // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
with thread function
unsigned long __stdcall CProjectv1Dlg::ThreadFunc(void* lpVoid)
{//let say again
while(1){
if(int a == 1)
m_result += " success";
}
return 0;
}
i oso created an editbox with a Cstring variable m_result.
now, my question is how can i update the editbox through the m_result variable?
thks for all the advice and help
regards,
afender
|
|
|
|