|
Hello,
I have a question regarding the way that the ComboBox control looks in MFC. - When I put the ComboBox on my dialog, and add some items in it, when I press the controlling button(the one that shows the list) it shows just a single item with two scrollbar buttons -> how to fix that so I can view my items in a normal list - like this
ComboBox
-----item----|
-----item----|
-----item----|
-----item----|
-----item----|
Thanks - Deian
|
|
|
|
|
I've the sollution for you: Beginning Visual C++ 6 by Ivor Horton
Considdered to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute). Greatings to my Guru "The bokkelul"
And experience with the one and only NewEra Guru.
|
|
|
|
|
Or open the dialog for resource editting, click on the dropdown button and change the size.
If you want to change the list height of the combobox during runtime. Create a new class and let it inherrit from CCombobox, add the message handler:
ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown)
and edit the OndropDown function like this:
void CMyComboBox::OnDropdown()
{
// This limits the maximum number of visible entries to 7
int nLines = min( max(GetCount(), 1), 7 );
CRect lprect;
GetWindowRect( &lprect );
lprect.bottom = lprect.top + nLines * GetItemHeight( -1 ) + lprect.Height();
SetWindowPos(NULL, 0, 0, lprect.Width(), lprect.Height(), SWP_NOMOVE | SWP_NOZORDER );
}
Good luck
Le Ridder Noir
Considdered to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru.
|
|
|
|
|
Or open the dialog for resource editting, click on the dropdown button and change the size.
If you want to change the list height of the combobox during runtime. Create a new class and let it inherrit from CCombobox, add the message handler:
ON_CONTROL_REFLECT(CBN_DROPDOWN, OnDropdown)
and edit the OndropDown function like this:
void CMyComboBox::OnDropdown()
{
// This limits the maximum number of visible entries to 7
int nLines = min( max(GetCount(), 1), 7 );
CRect lprect;
GetWindowRect( &lprect );
lprect.bottom = lprect.top + nLines * GetItemHeight( -1 ) + lprect.Height();
SetWindowPos(NULL, 0, 0, lprect.Width(), lprect.Height(), SWP_NOMOVE | SWP_NOZORDER );
}
Good luck
Le Ridder Noir
Considdered to be the worlds fastest knoppenbonker.
10 Months of working experience with the worlds fastest copie paster(about 2000 lines a minute).
And experience with the one and only NewEra Guru.
|
|
|
|
|
I have a problem with a popup menu - namely I want to set up a menu so it has some default commands that get added, and acted on within OnContextMenu, but I want to add them to an existing menu and send off my messages if any of the existing commands are selected. I can make one or the other happen, but not both. I have the command returned and am switching it's value. Basically I want to know what to put in the default case, where one of the id's I am looking for is not the value returned....
Thanks as always
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I have a little problem - when I change my toolbar background to a gradient in OnEraseBackground, buttons that have a transparent colour set remain square, with the underlying colour unchanged.
Can anyone tell me how to fix this ?
Thanks
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I am writing a wordprocessor application using CRichEditView as my view, I can do
all that
Word Procssor stuffs like "wordpad" application. But I want to implement cool
WYSIWYG page effet
like Microsoft Word (or any leading Word Porcessor).This involvs drawing page
borders
on the view and somehow move the cursor from one page to next page.....
Someone give me an idea, how to start? or where to for more details etc.....
_dave
|
|
|
|
|
I'm developing a program required to use Synchronization function WaitForSingleObject(). It may take several seconds or longer to run this function, therefore, I want to add a Progress Bar control to let the user knows how long do they need to wait. However, I cannot find the source code of this WaitForSingleObject() function, so I cannot put the progress bar SetPos() in that function. I've tried to set the progress bar move by timer...but when the program run WaitForSingleObject(), the progress bar stopped!
Do anyone know how to solve this problem?
|
|
|
|
|
WaitForSingleObject is a Windows API function. There is no source code for it.
You can't do what you are suggesting. About the closest you could get is to give WaitForSingleObject a timeout value, update the progress bar, then go back to waiting. That is a poor design, however, since your main message pump is locked and if some other window obscures yours, it won't redraw when the window is removed.
You usually want to use WaitForSingleObject in a worker thread, where message pump updates are not a problem.
|
|
|
|
|
Is that mean that if originally the timeout value is 16000....(WaitForSingleObject(xxxx, 16000)), then I split it into ... let say....5 ......e.g.:
WaitForSingleObject(xxxx, 3200);
Call ProgressBarControl;
WaitForSingleObject(xxxx, 3200);
Call ProgressBarControl;
WaitForSingleObject(xxxx, 3200);
Call ProgressBarControl;
WaitForSingleObject(xxxx, 3200);
Call ProgressBarControl;
WaitForSingleObject(xxxx, 3200);
Call ProgressBarControl;
So that the progress bar can update every 3200 time interval?.....
Sorry...I just a beginner in MFC programming;P
|
|
|
|
|
How to determine current logged on user?
|
|
|
|
|
You know, I don't usually get bent out of shape over simple questions, but it just annoys me sometimes that people don't use the resources that are at their disposal. VC comes with documentation that provides very easy searching for such things.
GetUserName() is what you want.
|
|
|
|
|
Patience Erik, patience. The question is simple for you because you know the answer. For others it can be a difficult system to master. The documentation is not as good as you suggest. Things can be hard to find, ambiguous, out of date or plain wrong. It's like camel sh*t in the desert: there is lots of it but it's not good to eat.
|
|
|
|
|
Is there a way to redirect the text output of a console program to an edit control, like an IDE that executes some kind of compiler program and shows the results in it?
Thanks a lot!
Erik
|
|
|
|
|
Yes it can be done. I recently developed a simple implementation of this in VC++ for a friend. It is not complete, but basically works.
If you would like the code, email me at gullettm@yahoo.com and I will respond with the code attached.
|
|
|
|
|
i draw something in scrollview.but the size of the screen is smaller than the size of the scrollview.i want to save all things in the scrollview to a bitmap file!
thank u first!
|
|
|
|
|
presumably you are building the bitmap in a memory device context (memdc) and so you would save it from there not the actual view
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
can u tell me more by email!
E_Mail:freesys@263.net!
Thank you very much!
|
|
|
|
|
1. copy the screen to an HBITMAP (CreateCompatible*, BitBlt)
2. use GetDIBits to get a DIB from that HBITMAP
3. fill in and write a BITMAPFILEHEADER structure to the output file
4. write the contents of the DIB to the output file
-c
-----------------------------
Image Processing and More :
http://www.smalleranimals.com
|
|
|
|
|
ummm ... 1. copy the screen to a bitmap?
surely you would be keeping track of the drawing in the document or whatever you're using and so wouldn't need to copy the screen?
or have i misunderstood something fundamental?
mostly watching the human race is like watching dogs watch tv ... they see the pictures move but the meaning escapes them
|
|
|
|
|
i understood his question as "how do i do a screendump of my CScrollView". he did say "bitmap file".
-c
|
|
|
|
|
save the drawing in the scrollview to a bitmap!
|
|
|
|
|
sorry!you are wrong!
not copy screen to bitmap!
save the drawing in the scrollview to bitmap!
the size of the screen is smaller than the size of the view!
|
|
|
|
|
sorry!you are wrong!
not copy screen to bitmap!
save the drawing in the scrollview to bitmap!
the size of the screen is smaller than the size of the view!
|
|
|
|
|
I am currently developing a feature for one of our products using the Microsoft Task Scheduler
Platform API (using Visual C++/MFC 6.x and the Platform SDK on NT 4.0). I have implemented
all requirements using the Task Scheduler API, but cannot find a way of determining whether or
not a Scheduled Task was missed (via the API).
The Microsoft Task Scheduler itself reports a missed Task in the Status column of the UI
as "Missed", but the API does not seem to expose a way to determine/report this.
Anyone know how would one go about determining that a scheduled Task was missed using the Microsoft Task Scheduler Platform API?
I'd greatly appreciate a code snippet detailing how this would be done?
Thanks, in advance.
David Birtwell
Software Engineer
Kronos, Inc.
dbirtwell@kronos.com
|
|
|
|