|
It worked. Thanks.... I have another similar question
I have two tree controls attached to the tabs in the tab control. To fit the tree control in the tab control what should I do? 'cause I can't write the wm_size handler for the tabcontrol as I'm adding the tree controls in the formview, not in the tabcontrol class.
|
|
|
|
|
I think you might be confusing a CTabCtrl with a CPropertySheet . A CTabCtrl doesn't "contain" child dialogs or controls - all it does is allow the user to select a tab. A tab control's parent receives notifications when the current tab selection changes.
That being said, what you probably want to do (to mimic the behavior of a CPropertySheet ) is to create a bunch of child controls/dialogs (whose common parent is your view), one of which is displayed in response to the change in the currently selected tab. You'll also need to check the "Transparent" attribute of the tab control so that it doesn't hide the child controls/dialogs. The appropriate control/dialog is displayed in response to a change in the currently selected tab in the following manner:
CWnd* pDisplayedWnd = NULL;
m_treeCtrl_1.ShowWindow (SW_HIDE);
m_treeCtrl_2.ShowWindow (SW_HIDE);
int nCurTab = m_tabCtrl.GetCurSel();
switch (nCurTab) {
case 0:
pDisplayedWnd = &m_treeCtrl_1;
break;
case 1:
pDisplayedWnd = &m_treeCtrl_2;
break;
default:
ASSERT (FALSE);
break;
}
ASSERT (pDisplayedWnd != NULL);
pDisplayedWnd->BringWindowToTop();
pDisplayedWnd->ShowWindow (SW_SHOW);
pDisplayedWnd->Invalidate();
pDisplayedWnd->UpdateWindow();
pDisplayedWnd->BringWindowToTop();
pDisplayedWnd->SetFocus();
If this is too much work, you might want to consider using a CPropertySheet . See the examples at CP if you need help.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Don't forget to call SetScaleToFitSize(cx, cy) at he end of your OnSize() procedure otherwise you will get scroll bars shown if the client rectangle size is smaller than the size of the dialog template used to create the form view from.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I'm using a formview here, setscaletofitsize() is for the scrollview. can you please tell me how I can use it for the scroller in the formview?
|
|
|
|
|
worked
SIZE sizeTotal;<br />
sizeTotal.cx= cx;<br />
sizeTotal.cy= cy;<br />
CScrollView::SetScaleToFitSize( sizeTotal);
|
|
|
|
|
Dear all,
In Windows 2000/XP platform, we can easily get this information from function DeviceIoControl with code IOCTL_DISK_GET_DRIVE_LAYOUT. However, in Windows 98/Me, we failed. We all know that most of the fields in this struct are located at MBR and the first sector of each partition.
typedef struct _DRIVE_LAYOUT_INFORMATION {
DWORD PartitionCount;
DWORD Signature; // ********
PARTITION_INFORMATION PartitionEntry[1];
} DRIVE_LAYOUT_INFORMATION;
typedef struct _PARTITION_INFORMATION {
LARGE_INTEGER StartingOffset;
LARGE_INTEGER PartitionLength;
DWORD HiddenSectors;
DWORD PartitionNumber;// ********
BYTE PartitionType;// ********
BOOLEAN BootIndicator;// ********
BOOLEAN RecognizedPartition;// ********
BOOLEAN RewritePartition;// ********
} PARTITION_INFORMATION, *PPARTITION_INFORMATION;
Unmarked fields are got easily from partition entries in MBR and the first sector of each partition. The marked ones are unknown. Therefore, my question is how to get those marked fields? I mean the other ways to get that information in Windows 98/Me platform. Thank you very much.
Best regards.
Tuan Dang.
____
Tuan
|
|
|
|
|
I have a program that runs as a service. It needs to run a program under another user's account. The service will have access to a username/password. The service, of course, is running under the System account.
I have investigated CreateProcessAsUser, but for the life of me I cannot get it to work as expected! I can use LogonUser to get a token, and then pass it to CreateProcessAsUser, which dutifully runs the program and returns no errors, but from all observations, the program does not seem to run under the right account.
Any ideas? I'd post code, but it is pretty bulky. I got it from an article here on CP about a Telnet server. OR just to test, is there a relatively easy way I could, say, print the name of the user I'm running the code as, or some other sure-fire test?
This service may be running with or without the given user logged on, so I'm not sure if that makes a difference.
Thanks.
"I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
|
|
|
|
|
Maybe this is at a tangent to what you're asking ...
What privileges does your service have ?? - My security handbooks are at home, but I would have thought to be able to do this you would need higher privileges than a standard account (or the local system account) ..
'G'
|
|
|
|
|
It would seem odd to need higher priveleges than the standard System account... doesn't that have pretty much everything?
And then who'd be able to set the system account privileges? Granted, I wouldn't be surprised if this were the case... although that would pretty much sink any hopes I'd have of implementhing this idea.
"I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
|
|
|
|
|
AFAIK, CreateProcessAsUser and LogonUser need the following four privileges: SeIncreaseQuotaPrivilege, SeAssignPrimaryTokenPrivilege, SeChangeNotifyPrivilege, and SeTcbPrivilege
Im just looking for some articles that may help you ...
'G'
|
|
|
|
|
|
Thanks for your info. I'd rather be flooded with info than have no info at all.
"I'd be up a piece if I hadn't swallowed my bishop." Mr. Ed, playing chess
|
|
|
|
|
Hi all
I wrote a large MFC application and recently began to convert it to .NET framework. I do this step-by-step by rewriting some parts and components written in MFC into C#. Now I have application written in MFC with a lot of C# components talking between them using com-interop.
But now i want to perform some serious testing. I've tried some available products such as Rational Quantify and DevPartner and all of them had problem to handle with my app because it written both in MFC and C#.
What is the best way to test such app (CPU, memory etc.)?
Can anybody recomend me about some other monitoring product?
thanks.
|
|
|
|
|
i honestly dont know anything that does that. but let me tell you sth. about c#.
the 2 languages C & VB are just fine. VB is for kids or persons who just don't need more than a window with buttons and images in their lifes;C is a lower-level language, the coolest i know about. but the microsoft morons decided to rise the VB level for the VB community to have pointers and stuff and to lower the C's level, nobody knows why. why, my friend are you sinking to c#?
kill bill!
|
|
|
|
|
Hi all!
In my application I'm using mnemonics for the control buttons but when I run it, they don't appear until I press Alt key. Could I see'em when I run the application and don't press the key anyway?
Thank you in advance!
I have no idea
|
|
|
|
|
That's a feature of the OS. You can turn it off in the Display properties (the exact location varies among OSes), it's called "Hide keyboard navigation until I press the Alt key" or something similar.
--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | 1ClickPicGrabber New v2.0.1! | RightClick-Encrypt
"Linux is good. It can do no wrong. It is open source so must be right. It has penguins. I want to eat your brain."
-- Paul Watson, Linux Zombie
|
|
|
|
|
Thank you!! I was going nuts!
|
|
|
|
|
Hello,
I have a MDI application with 2 document types and I am using DundasSoftware's Tabbed View control.
On startup of my application I open 2 documents one is of CListView and the other is a CHtmlView. I force both views to Maximize (this way the user has to use the tab's to go between views/documents).
My question is, I only want the "x" (close button) on the child frame to be shown. I don't want the user to have the option to minimize or restore down the view/document.
I have tried OnPreCreateWindow to remove the MinimizeBox and Maximize box.. this works except it still shows the "RestoreDown" box... any Ideas??
Thanks!!!
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Rob,
What you are getting is the standard behavior of CMDIFrameWnd. I suggest you remove the WS_SYSMENU style from CChildFrame::PreCreateWindow():
cs.style &= ~WS_SYSMENU;
You will have no buttons and no system menu. If you still want to be able to close a view you must provide another approach (maybe a toolbar button).
Ivor S. Sargoytchev
Dundas Software
|
|
|
|
|
Yeah thats what I figured.. I was just hoping someone had a secret
Thanks, That's what I'll have to do.
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hi everyone!
Is it possible to write different lines in a multiline Edit Box without pressing CTRL key + Enter anyway? I mean, could I write different lines only pressing Enter key?
Thank you in advance!
I have no idea
|
|
|
|
|
Yes, just use the ES_WANTRETURN style.
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
I'm trying to find how to use it, but I'm not lucky today
Could you show me an example for this command or tell me an URL where I could find it?
Thank you for your help
I have no idea
|
|
|
|
|
http://search.microsoft.com/search/results.aspx?View=msdn&st=a&qu=es_multiline&c=4&s=2
http://www.google.com/search?hl=en&ie=UTF-8&oe=UTF-8&q=es_multiline&btnG=Google+Search
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Hi,
Edit Box dialog means right click and open properties dialog box. in that styles tab is there, here want return check box click and enable it enough.
Have A Nice Day!
Murali.M
|
|
|
|