|
That's it!
Thanks a lot
Regards
Bartek
|
|
|
|
|
I am creating buttons dynamically in my dialog box by creating them as windows using CreateWindow and putting bitmaps on top of the buttons. This works fine, however, I want to change the background colour of these buttons to a lighter colour. I'm guessing that I use SendMessage but as to which message and parameters I'm lost. Could anybody point me in the right direction. I've checked some articles but they are geared more to using the resource editor or owner-drawn buttons.
Thanks in advance for any help,
Nick
|
|
|
|
|
Sorry - you can't change the background of the button with one simple SendMessage. And processing WM_CTLCOLORBTN won't help either; here's what MSDN says:
Buttons with the BS_PUSHBUTTON, BS_DEFPUSHBUTTON, or BS_PUSHLIKE styles do not use the returned brush. Buttons with these styles are always drawn with the default system colors. Drawing push buttons requires several different brushes-face, highlight and shadow-but the WM_CTLCOLORBTN message allows only one brush to be returned. To provide a custom appearance for push buttons, use an owner-drawn button.
So, if you need custom background, you have to use owner-draw.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Ok, thanks, I suppose I can get around it by altering the bitmap itself to have a white border or something, I'll work on that. The reason I wanted to do it was because some of the bitmaps I was drawing had a grey edge on some sides which was the same colour as the button itself so the border wasn't showing.
Thanks anyway,
Nick
|
|
|
|
|
Hi
can you advise for me library with tree template class, like STL list or vector
Ernst
Thanx
|
|
|
|
|
map is a balanced, sorted binary tree.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Hi everyone!
I am writitng a MDI application with CRichEditDoc and CRichEditView classes.
Now I want to add some spliter windows so I added like this:
Project>add to project>components and
controls>visual c++ components>splitter bar"
when i run the application the splitter is created, but my childframes
windows look very
funny. I have 2 vertical scroll bars and 2 horizontal scroll bars, one is
the default that comes with CRichEditView, and the second is the one created
by the splitter. If I drag the splitter bars somewhere in the middle and
then begin typing something
in one pane I cannot synchronize the text in all the panes. Also the scroll
bars seem not to be working properly.
I have posted this topic on several forums, but nobody seems to know the answer!
Please give me some help
Alex
|
|
|
|
|
Hello,
I think that all is asked in the subject... Indeed I'm working under Windows CE 3.0 more accurately. All Microsoft apps do this to display the standard Copy/Cut/Paste menu, but I really don't understand how it's done.
By the way if anyone knows where to find such sources (from Microsoft standard apps packages provided on PocketPC, or from anyone else°, I would really appreciate.
Thank you.
Please, also send your answers to my email address: francois_pessaux@yahoo.fr
--Francois
|
|
|
|
|
|
1. How knowing full path to a file and current directories to receive relative path to a file?
2. And on the contrary, knowing a relative path and current directories to determine a full path to a file?
|
|
|
|
|
Look at this 2 functions
char *_fullpath( char *absPath, const char *relPath, size_t maxLength );
void _splitpath( const char *path, char *drive, char *dir, char *fname, char *ext );
|
|
|
|
|
Hi,
How can I get Start menu and pop it up anywhere on screen like user have clicked on Start button ?
thans a lot,
|
|
|
|
|
hi,
I am using a property page to get Tabs in my project in one of the tab. I Need to have a splitter window
can any one help me in doing this.
|
|
|
|
|
hi,
I am using a property page to get Tabs in my project in one of the tab. I Need to have a splitter window
can any one help me in doing this.
|
|
|
|
|
Hi,all
I got an error when I run one window about 80 times.The error is like the following:
Second Chance Assertion Failed: File afxwin1.inl, Line 283
source code in "afxwin1.inl" is the following,
282: _AFXWIN_INLINE int CGdiObject::GetObject(int nCount, LPVOID lpObject) const
283: { ASSERT(m_hObject != NULL); return ::GetObject(m_hObject, nCount, lpObject); }
m_hObject is a NULL pointer when I load a bitmap(bitmap.LoadBitmap(..)). these code runed for about 80 times recycled, then I get a NULL pointer m_hObject. but I don't know why m_hObject is not a NULL pointer when these code run for the first 80 times.
I think it is a memory leak error,but after every CBitmap object was used, DeleteObject() was followed. Could anyone give me some advice about how could result in this error, and how can I fix it.
Thanks.
|
|
|
|
|
This '80 times recycled' points to a GDI resource leak. Probably you have your bitmap selected into some device context when you 'recycle'. In such case, old bitmap isn't deleted.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I called the API ::playenhmetafile to play a metafile under win98. If I play three hundred files once time, it will cause bad gdi leak and gdi resource fall down to zero. But it works well under win2000. why?
thanks to all the programmers who have helped me.
|
|
|
|
|
Because Windows 2000 detects memory leaks and cleans up after you. Ar you *sure* you aren't leaking memory ? I'd suggest posting your code, I'd be happy to provide a sanity check.
Are you calling ::DeleteEnhMetaFile(); ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
Is it possible to create a memory device context with specific resolution and pixel depth (LOGPIXELSX, LOGPIXELSY, BITSPIXEL, et), rather than simply copying the values for an existing device?
I need to play windows meta files into a DC in order to generate bitmaps which will be saved as various raster file formats. The x and y resolution as well as the pixel depth of these files are not related to the resolution of the display or to any attached printer.
I am currently doing this by specifying ANISOTROPIC mapping mode, and setting the Window and Viewport Extents as required.
This works for some of the metafiles, but unfortunately, many of them explicitly set the mapping mode or extents internally. I have used EnumMetaFile to trap these commands, but it would be much easier (and faster) if I could simply create a device context with the correct parameters and just play the metafile.
Any help or tips would be greatly appreciated.
Thanks,
Bill
|
|
|
|
|
I'm writing a word processor and need to draw lines across my RichEditView to represent page breaks.
Unlike a basic CView, CRichEditView doesn't seem to use OnDraw to update the display, so overriding this seems to have no effect, and using OnPaint stops the text being displayed altogether.
Is there a way around this or should I just give up???
|
|
|
|
|
Hi fellow programmers!
Ok, here is the situation:
I am writting program consisted of 1 exe and about 5 dlls.
I have a structure(struct Options) which has all the programs variable in it. in My main file I defined
Options O;
then in other .cpp files I defined it
extern Options O;
this structure holds all variable, and works great in my exe program. However I want to export this instance (Options O) to my dll files so my dll files can use the variables inside this certain instance of the structure.
How can I do that? because in my DLL files when I import the extern Options O. It creates a new instance of Options and it doesn't use the variables which are already being used in the exe file;
I am totall puzzled!
some one please help me!!! I really appreciate it! please ask me if you need more information to answer my question!
Best regards to you all!
Damon
|
|
|
|
|
Basically, you should encapsulate the options:
1) In some DLL, create a function that returns the address or reference
Options& GetOptions()
{
static Options options;
return options;
}
2) export that function from the DLL
3) whenever you need the access to options, use GetOptions.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Look at this page by Ryan Schneider.
A Simple Wrapper for Sharing Data Structures Between Processes
http://www.codeproject.com/useritems/csharedstruct.asp
Another approach could be an initialization function in every dll
// in your exe .cpp
Options O;
MyDllInit( O );
// in your dll .cpp
Options O_Dll;
void MyDllInit( Options &O )
{
memcpy( &O_Dll, &O, sizeof(Options);
}
|
|
|
|
|
Hello!
I have a great problem.
I have done a view showing a bitmap.
The view always fits the size of the
bitmap. In the case, that the view
is smaller than the bitmap, scrollbars
are shown to scroll over the bitmap.
Now I want to implement the maximize
functionality that way, that pushing
the maximize button expands the view
to fit the bitmap only, but not to the
size of the mainframe window. How can
I implement this functionality. I already
catched the corresponding messages in
OnSysCommand and I can resize the view
to fit the bitmap, but I can not change
the maximize button to the restore button.
Is anyone out there who can help?
Many thanks in advance.
Peter
from Vienna
pmrainer
|
|
|
|
|
There are a number of ways to do this. You can turn OFF the maximise button in the view window, you could capture WM_SIZE and when the window gets a message to size bigger than the bitmap you could make it size to just the bitmap, or you could just allow the maximising and centre the bitmap.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|