|
If you mean code to return an ID that isn't used you could use the EnumChildWindows and GetWindowLong with the GWL_ID parameter to conjure one up. If you're not talking about making one at runtime "Owner drawn" has a point - although generally the dialog editor will make sure you get a unique one.
Steve
|
|
|
|
|
I have a macro that renumber resources in resource.h sequentially. Depending of what did you mean with your question, it might help.
Igor Green
http://www.grigsoft.com/ - files and folders comparison tools
|
|
|
|
|
Dear members
Plz suggest me some code to colourize the scrollBars of a MDI application
Thanks
rohini sharma
|
|
|
|
|
|
Ahh, colour spelt with a "u". As an Australian programmer I always have to "misspell" colour (when wearing my programming hat).
Steve
|
|
|
|
|
See WM_CTLCOLORSCROLLBAR (for scrollbar controls only).
Also see Flat Scroll Bars - In particular the FlatSB_SetScrollProp function.
Steve
|
|
|
|
|
Hi,
My PC is having dual screen setup and I would to display a child window of my MFC application to be displayed on second screen. Is there any way to make the application to display like tht??? I would also like to know if there is a way to make the main application to be displayed on secondary screen, so that the child window can show up on the primary screen??
thanks,
-Pavan
-- modified at 22:50 Thursday 12th January, 2006
|
|
|
|
|
A child window is always within the boundaries of its parent, so you can't have a parent window and a child window on separate screens. You can, however, put a non-child window on a different screen. After all, it's only a change in the position of the window.
Use EnumDisplayMonitors() to get the display rectangles of all the installed monitors.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
With two monitors, you just have a larger screen. So if with one monitor you have a screen that is 1024 x 768, with two monitors both set to the same resolution, the screen will be 2048 x 768 if they are arranged side by side, or 1024 x 1536 if one is logically above the other. (I find the vertical arrangement confusing, but very handy for word processing when you want two views on the same document.)
Be warned though, that with two monitors the screen coordinates can now be negative. The primary monitor will always have it top left corner at 0, 0 but the secondary monitor (assuming that you ONLY have two) can be placed to cover any rectangle that touches the primary monitor's screen area. So the secondary monitor could be up and to the ledt and have its top left corner at -1024, -700. You will find it tricky to navigate your mouse between the two in this case.
Also, now that you have two monitors, make a point of checking out code to handle monitors. Some companies write software that pops up dialogs that can not be moved, and which come up right in the middle of the screen. So the dialog is half on one monitor and half on the other. Make sure this does not happen to your code!
Shraddhan
|
|
|
|
|
So I edit the afxdlg.rtf file in ignorance and completely whacked all the tags and other formatting, and subsequently attempted to re-generate the help files.
The upshot is that the help files are hosed.
AfxDlg.rtf is auto-generated by the MFC AppWizard; is there a way to RE-generate this file?
|
|
|
|
|
Nick Cassavaugh wrote: AfxDlg.rtf is auto-generated by the MFC AppWizard; is there a way to RE-generate this file?
As far as I remember, the file AfxDlg.rtf is generated by the AppWizard, but leaves lots of places for you to modify. If you have totally lost the original file, you could create a new project like your current one, copy the file, and delete the new project. Then make a copy of it just in case.
But why are you using the old style help compiler? Use the newer HTML help system. You get a better product, and if you have to start from the beginning anyway, there is not much lost.
Shraddhan
|
|
|
|
|
Hi,
I am trying to launch a process (a Web browser) from inside a screensaver app using ShellExecuteEx. I can get the new process spawned, but it terminates when the screensaver quits. Is there a way to launch it as an independent process so it stays active after the screensaver quits? Thx.
Bodhi
|
|
|
|
|
I'm surprised to hear that - Once a process is launched it should be independent of the process that spawned it. Have you any more info?
Steve
|
|
|
|
|
Thanks for writing. It is a weird problem. I'm using VC++ 6.0, Windows XP Pro. If I launch the 'saver manually from the shell, or through the display properties screen saver preview, no problem. If the 'saver is launched by the system (i.e., as it normally would be), the browser (or Control Panel, or Appwiz) process it spawns is active only until the 'saver terminates.
|
|
|
|
|
I broke out my old "Pay rise" screen saver (it's a long story) and modified it to launch another process. Sure enough it behaves exactly as you say. I tried using ShellExecuteEx and CreateProcess but it happened with both. I think this ones gonna be hard to crack - Smells like some security "feature". Good luck (I suspect you'll need it).
Steve
|
|
|
|
|
The ScreenSaver runs in a separate desktop from the regular user logged in.
When you launch the new app, it is created in same desktop as screensaver, and it is terminated when the screen saver desktop ends.
You might try SetThreadDesktop on your newly created app, before the screen saver quits. There might be a way to specify which desktopthe app gets created in using one of the parameters with the CreateProcess call. I don't think you have very much control with the ShellExecuteEx.
So, indirectly it is a security feature you ran into.
|
|
|
|
|
When I use ondrawitem to draw the owner draw button, the button is seem very blunted. The code is just like the article "The art of subclassing".
Please help!
|
|
|
|
|
|
In fact that I only do
if ((state & ODS_SELECTED)|m_ClickControl)
pDC->DrawFrameControl(rect, DFC_BUTTON, DFCS_BUTTONPUSH|DFCS_PUSHED);
else
pDC->DrawFrameControl(rect, DFC_BUTTON, DFCS_BUTTONPUSH);
rect.DeflateRect( CSize(GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)));
if (m_ClickControl)
pDC->FillSolidRect(rect, RGBBUTTONDOWNCOLOR);
else
pDC->FillSolidRect(rect, RGBBUTTONUPCOLOR);
in the onDrawitem.
Please give me more hints to solve this problem!
|
|
|
|
|
LaHaHa wrote: if ((state & ODS_SELECTED)|m_ClickControl)
Why are you doing this(m_ClickControl). I guess you are checking for the button pushed state. You only need to check for (state & ODS_SELECTED). That will suffice.
LaHaHa wrote: if (m_ClickControl)
pDC->FillSolidRect(rect, RGBBUTTONDOWNCOLOR);
else
pDC->FillSolidRect(rect, RGBBUTTONUPCOLOR);
Even for this the above rule applies.
Jesus Loves <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
The m_ClickControl is used to hold the button state.
But even I remove the m_ClickControl, the button has the same problem.
It will has a short time that cannot be clicked.
Please help!
|
|
|
|
|
Oh he had a problem with u
Vikas Amin
Embin Technology
Bombay
|
|
|
|
|
So he help me! Just joking!
|
|
|
|
|
LaHaHa wrote: the button is seem very blunted
Can we see the picture so we understand what u mean?
-Prakash
|
|
|
|
|
In fact that the button is just look like simple button.
When you click the first time, it will response to your click.
If your second click is very fast, it will not pushed.
It need about 1 second between each click, then it will seems no problem.
Please help!
|
|
|
|