|
Hi, when I'm changing Windows colors, my ownerdraw buttons (CBtnST)do not handle this. Which message do I need to handle? Thx for help.
|
|
|
|
|
Have you looked into the:
WM_SYSCOLORCHANGE
WM_SETTINGCHANGE
WM_WININICHANGE
Messages? They should be a good starting point...
Peace!
-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
[Get Check Favorites 1.4 Now!]
|
|
|
|
|
Anonymous wrote:
my ownerdraw buttons (CBtnST)do not handle this.
Here is the patch
void CButtonST::OnSysColorChange()
{
CButton::OnSysColorChange();
SetDefaultColors(TRUE);
m_dcBk.DeleteDC();
m_bmpBk.DeleteObject();
}
|
|
|
|
|
Is there a way to create a CMDIFrameWnd in a CMDIChildWnd view.
My firts idea was to create a CFormView with a static control an then create a new CMDIFrameWnd on this (static) CWnd.
Second idea was to create the CMDIFrameWnd directly while creating the (CMDIChildWnd) view.
I can't find in the documentation if you can have more than one CMdiFrameWnd in an app without causing some kind of problem. But I also can't find that you can't do this anywhere.
Any help would be greatly appreciated.
Samplecode also.....
Thorsten Koch
BTW: I don't want splitter windows
_________________________________________
"If Microsoft ever does applications for
Linux, it means I've won."
- Torvalds, creator of Linux OS -
|
|
|
|
|
I desperately need a grid control that I need to use to dsplay data..I have no use to bind it to a data contorl or the likes...I need to display content from the serial port in the grid...
the problms is that I need to resize the grid depending upon the incoming data. so I need to dynamically change no of rows and cols and I want to resize the size of the grid to the exact size of rows adn cols....
since, valued such as GetColWidth() and GetGridLineWidh() are in twips, I need some way to converte them to pixels in VC...
can some1 tell me how I get the current scale of Twips-Pixels (using either GetDeviceCaps() or GetSystemMetircs() )
in VC++?
thks
If you want a helping hand, you'll find one at the edof your arm.
|
|
|
|
|
|
Hello Friends
Hi ! there,,,need some help,,i hope someone will comeforward,,,
This is stupid question i know but still i want to know where i am wrong.
I have a SDI application with map displaying on that having some symbols,,,and a dialog box where uneditable related information is displayed,,,
Whenever i move the Dialog box in the Background the Map is getting effected i.e i have few symbols which are disappearing randomly,,,
I tried to fix the bug ,initially by WM_MOVE method for that dialog.,,but the problem is that it is not at all displaying any changes,,i tried first for a mere message box,,but stil it is not working,
Can any one ple solve this,,
Thanks in advance
Bye
Thanks & Regards
Neonave
|
|
|
|
|
Your English is a little broken so it's a bit difficult to understand your problem. If it's a drawing problem that you're having, take a look a the OnDraw method. If you want to make your window update the drawing region after a dialog (or any other window for that matter) obstructs it, OnDraw is where you should place the drawing code. If you are doing some drawing outside of the OnDraw method, that is OK, you just have to ensure that OnDraw knows the last state of the drawing area.
I'm not sure I'm on the right track here, so let me know if this sounds helpful. The "symbols" you speak of may be disappearing because you're not re-drawing them. Not sure what's going on exactly, though. Can you clarify?
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi All,
The prob is as under:
I have a main app... lets name it "MainApp"... and a DLL named "PlugIn1"..
When I clck on one of the menu optins in the main app's window, DLL's InitPlugIn Function is called, where a new toolbar button is created... that is , a new button is appened, to the default toolbar of the main app...
I have mentioned the button state as TBSTATE_ENABLED, but still it is not enabled.... It appears as disabled...
I am using doc/view arch...
and VS7
also, one more prob, where to handle it's event... whether in the DLL or main app???
I have tried handling it in main app's Mainframe --->> OnCommand () handler... but no event is generated, when i click on this button... may be because it is disabled....
So my main prob is how to enable that button...
Please do help me... it's kinda urgent...
Thanks in advance,
Mohit Khanna
|
|
|
|
|
toolbar buttons will normally appear dimmed out if they do not have a message handler associated with them, so it sounds like the real problem is where to handle it, as once the event is handled the button should not be dimmed out.
make sure that you have the right ID for the button that is created, since the button is added to a toolbar that is a member of CMainFrame i would assume that the command should be in the CMainFrame's message map..
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
ON_COMMAND(ID_OPTIONS, OnOptions)
END_MESSAGE_MAP() wish i could help more.. but im a newbie..
-dz
|
|
|
|
|
Hi Dazinith,
Actually in your way you are right... Messages for the toolbar can be handled in CMainFrame class... but the actual prob is that... One or more buttons are added to the toolbar dynamically by the DLL... so the CMainframe class does not know before-hand about the buttons... also the resource ID for the button may be DLL dependent... so the ideal place to handle that button's functionality is in the DLL itself...
It may be that DLL be written by a third party who does not know about CMainFrame's code... so in that way..
the application can be very flexible... so how to do that???
till know the status is.. button is being displayed... on the toolbar...
but is disabled....
how to specify the message handler... i have tried it but it still isn't being enabled...
IS it regarding to the resources???
Please someone help me on this... it's really bugging me ...
Thanks in advance...
Mohit
|
|
|
|
|
How do I set/change an IP address on Windows NT/2000 using the Windows API by C/C++ code?
|
|
|
|
|
How can i display .bmp file on 300 DPI rather than 72dpi ( as window by
default shows images on 72dpi).
Sikander
|
|
|
|
|
What the hell are you talking about ? The d in dpi is dots, i.e. the number of pixels in your image. If you want it smaller on the screen, use StretchBlt.
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Christian Graus wrote:
What the hell are you talking about ?
Please, don't be rude when answering posts! What purpose does it serve other than that people get scared and intimidated...?
Be well,
/T
|
|
|
|
|
you can use SetWindowExt/SetViewportExt to change the effective DPI of the display.
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(CSize(300,300));
pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX), pDC->GetDeviceCaps(LOGPIXELSY));
..
..
pDC->SetMapMode(MM_ISOTROPIC);
pDC->SetWindowExt(CSize(72,72));
pDC->SetViewportExt(pDC->GetDeviceCaps(LOGPIXELSX), pDC->GetDeviceCaps(LOGPIXELSY));
as long as you set the Window Extent to your image's DPI, the image will be drawn at the correct size.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Say wha ? How can that have any meaning at all ?
Christian
I am completely intolerant of stupidity. Stupidity is, of course, anything that doesn't conform to my way of thinking. - Jamie Hale - 29/05/2002
Half the reason people switch away from VB is to find out what actually goes on.. and then like me they find out that they weren't quite as good as they thought - they've been nannied. - Alex, 13 June 2002
|
|
|
|
|
Christian Graus wrote:
How can that have any meaning at all ?
because each word itself has an individual meaning which is shared by speakers of the language; and together the words' meanings, joined by way of the syntax and grammar rules also shared by speakers of the language, coalesce into a thought. this is how people communicate.
-c
Cheap oil. It's worth it!
|
|
|
|
|
Yep... Saw that one coming...!
Peace!
-=- James.
"Some People Know How To Drive, Others Just Know How To Operate A Car."
[Get Check Favorites 1.4 Now!]
|
|
|
|
|
yeah, i know. i'm a snippy bastard. but i mean well !
-c
Cheap oil. It's worth it!
|
|
|
|
|
Thanks Chris.. Your answer has solved my problem very well.
sikander
Sikander
|
|
|
|
|
I try to delete the key HKEY_LOCAL_MACHINE\SOFTWARE\\mykey and the system fails showing the message: "Cannot delete \mykey. Error while deleting key.".
How could i delete it?
rechi
|
|
|
|
|
Does it contain subkeys?
If so, use SHDeleteKey() instead.
|
|
|
|
|
The problem is that i can't delete it using Registry Editor. I don't have access to the key.
rechi
|
|
|
|
|
I've had this problem before. I get around it by doing the following:
Log on as administrator.
Run regedt32 . Note, it is imporant to use regedt32 and *NOT* regedit !
Go to the offending key, and go to the Security | Permissions dialog.
You should then be able to change the permissions of the key so that it can be removed.
You can do this programmatically too in much the same way, although the Windows security API is a bear.
No generalization is 100% true.
Not even this one.
|
|
|
|