|
What I've done in a similar circumstance is to have two dialog boxes.
One - the parent dialog box (BoxA), with the OK, Cancel and scroll bar.
It also has a placeholder static control.
I then replace that placeholder with a CWnd descendant custom control (ControlA). (Though you could just create it directly - I prefer to use the dialog box resource editor for ease of layout).
THAT child window that creates a modeless dialog box, which has your 25 odd controls on it (BoxB).
Then the scroll bar sends WM_xSCROLL messages to BoxA, which then pass to ControlA - which moves BoxB about. ControlA clips BoxB, and tada!
Simple, eh?
Needless to say, when it got a bit more complex I replaced the lot with a wizard like you want to do...
Iain.
|
|
|
|
|
Hi Everyone.
How does one make a program always run when a computer is started without doing it manually. For example when a person installs a program, how do they make it appear in the system tray and run automatically every time the computer is started.Is it part of the coding how is this achieved. Please help.
Wamuti: Any man can be an island, but islands to need water around them!
Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
|
|
|
|
|
the easiest way to get an app to start each time Windows starts is to drop a shortcut to the EXE in the Windows Startup folder. putting the app in the tray is a somewhat different job, but there are plenty of articles on CP that describe how to do it. here's one, for example: http://www.codeproject.com/KB/shell/trayicons.aspx[^]
|
|
|
|
|
Shell_NotifyIcon is called in the app to manipulate its tray icon(s).
|
|
|
|
|
Hi All,
I am developing one 'Text editor' kind of application. I want to put a menu item for showing the line numbers. I am using text buffer for displaying the file contents and this Class is derived from CView base class.
I added margin column and by using textout() function i am able to display the line numbers also(by converting the integer line number into string format), but i am getting the problem while scrolling. When i tried to scroll down by using 'down arrow' key some spaces are added at starting of every line, when i scorll up those spaces are deleted.
Please help me how can i solve this refresing problem ???
Regards,
Sanjeeva K Kanakam.
|
|
|
|
|
Maybe you need to post the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Member 3901790 wrote: ...this Class is derived from CView base class.
Instead of CEditView or CRichEditView ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi Frnds,
I am working on learning concepts of Design Patterns these days.
Could you please refer to any good online material? Best would be some video tutorials?
Thanks In Advance.
Geek
Keep DotNetting!!
GeekFromIndia
|
|
|
|
|
Just to add to the question...
Is there any good forum to discuss Design Patterns???
Keep DotNetting!!
GeekFromIndia
|
|
|
|
|
geekfromindia wrote: s there any good forum to discuss Design Patterns???
Design and Architecture one looks promising. Doesn't it?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
thanks Pallini...didnt notice we have separate forum for Design and Architecture here..
I'll see if guys there can help with some good references...
Keep DotNetting!!
GeekFromIndia
|
|
|
|
|
This book [^] isn't a online free resource, but IMHO is worth the purchase.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
yeah...i have this book by GoF
But for a starter i feel this is much complicated and time consuming...
I am looking for something simpler and with real-time examples
Keep DotNetting!!
GeekFromIndia
|
|
|
|
|
|
CRect rc;
GetClientRect(&rc);
rc.top=rc.bottom-48;
CBitmap bmp;
bmp.LoadBitmap(IDB_48x48);
CBrush br(&bmp)
pDC->FillRect(&rc,&br);
The topleft point of the rectangle is not the topleft point of the bitmap.
How to solve the problem?
Thanks.
|
|
|
|
|
From "Programming Windows with MFC, Second Edition" (Jeff Prosise).
Adapt the sample as you need for your code.
// Always set the same relative starting point for hatched brushes
CPoint point(x1,y1);
dc.LPtoDP(&point);
// Modulo of 8 since values should be 0 thru 7
point.x%=8;
point.y%=8;
brush.UnrealizeObject();
dc.SetBrushOrg(point);
dc.SelectObject(&brush);
dc.Rectangle(x1,y1,x2,y2);
|
|
|
|
|
Yes, I've just tested it, it works.
But why modular of 8? I just ignored it, there seems no problem.
|
|
|
|
|
From MSDN:
CPoint SetBrushOrg( int x, int y );
CPoint SetBrushOrg( POINT point );
Parameters
x = Specifies the x-coordinate (in device units) of the new origin. This value must be in the range 0–7.
y = Specifies the y-coordinate (in device units) of the new origin. This value must be in the range 0–7.
point = Specifies the x- and y-coordinates of the new origin. Each value must be in the range 0–7. You can pass either a POINT structure or a CPoint object for this parameter.
|
|
|
|
|
Remember that you may be getting a false positive if things line up correctly now. You might choose to write off the need to perform the modulus now but I would recommend doing it so that future uses of the code snippet that might be used with scroll bars, transformations, offset origins won't suddenly throw you a curve ball.
At least leave it in there, commented out, to remind you if that day ever comes.
|
|
|
|
|
Hello friend,
I have created a MFC Dialog based application and launches it using service when PC boots.
When I run my application on WinXp with IE6.0 it runs fine.
But, I run my application on WinXp with IE7.0, [logon/logoff/restart/shutdown] all WinXp standard functionality doesn't happens.
But when i kill my application and then try, all WinXp standard functionality works fine.
Please give me a solution that i can run my application using service and it solves IE7 problem.
I am currently using VC++6.0,Platform SDK SP2.
abhi
|
|
|
|
|
AbhijitAkude wrote: But, I run my application on WinXp with IE7.0, [logon/logoff/restart/shutdown] all WinXp standard functionality doesn't happens.
Does this mean that Windows is not shutting down when your application is running?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, Window not restarting or shutting down. It happens with any application creates using "MFC AppWizard exe".
abhi
|
|
|
|
|
By chance are you intercepting the WM_QUERYENDSESSION message?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
WM_QUERYENDSESSION and WM_ENDSESSION both are absent in my apllication.
The scenario on my PC:
i)I have 3 Administrator user and one limited user.
ii)run MFC application using service while PC boots on system account.
ii)Now,I am logged in 1st Administrator, and Switch in 2nd user without log off, repeats the same procedure for other accounts.
iii)Now try to log off/reboot.Windows Log off/reboot doesn't work.
abhi
|
|
|
|
|
Hi,
I have created an OpenGL window and can draw on it fine in the same thread as the one that created the window and processes the message queue. If I move the gl code to another thread, it does not draw anymore.
Does anyone know if this is possible?
thanks,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proof programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|