|
RajiRaghu wrote: Any clues to implement a list item as a hyperlinked text using MFC?
You can OwnerDraw the list box to make it's items to behave like a hyperlink. When the mouse is over the item set the forecolor to blue and underline the text. When out restore previous state. Changing mouse cursor also looks good.
There are selection change event handlers that can do the click part.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Its not for your problem but maybe it is some helpful to you Here[^]
whitesky
|
|
|
|
|
Hai to all
whenever i make a new project(MFC(exe)) in vc++ and execute it then it
gave to message box "could not execute:invalid directory(win32,error 267)
and then could not execute the program.
please any one tell me why not my program is execute.
Thanking you
mailing me
Yogi
|
|
|
|
|
Check the directory settings from the Menu Tools>Options [Directories tab]
If it is incorrect put the correct value
|
|
|
|
|
Is there any code in vc++ to shut down the local host system and remote machine.One of my friend told there is code in VB to shutdown the system.Is there in MFC?
|
|
|
|
|
ExitWindowsEx()
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Actually there no intrinsic function in VB6 for shutdowning the System. It uses Shell TypeLibraries to utilise the Shell features. In MFC I dont' know where there is such a fesiloty available now. But you can shutdown the local system using the function ExitWindowsEx( UINT, DWORD )
The first parameter Indicate action of Exit it should be EWX_SHUTDOWN for shutdowing the system
The second parameter is the type of Shutdown it could be either EWX_FORCE of EWX_FORCEIFHANG
|
|
|
|
|
|
|
How can i resize the dialog box controls when i resize the dialog box??
|
|
|
|
|
sruti_p wrote: How can i resize the dialog box controls when i resize the dialog box??
Well you've got to design a layout manager. Just like the ones you find in Java.
The best place to trigger a layout is WM_SIZE .
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
But how can i do this? is there any function for this??
Thanks for reply.
|
|
|
|
|
sruti_p wrote: But how can i do this? is there any function for this??
It should be easy to find one. Hey CP has one for sure I think I saw one.
Of course WhiteSky has mentioned two. But they work on a single control. But the above mentioned technique can take a bunch of controls and resize them as your specify.
I think I saw one or two or three... of those layout managers in Code Project. Please check.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Thanks for ur reply.
|
|
|
|
|
There is no need to design a layout manager. You just have to resize the dialog box controls as follows.
1. Get the Client rectangle of the Dialog Box. ( Use: GetClientRect(LPRECT))
2. Calculate the new size of controls.
4. Validate whether the dialog controls are valid window ( Use; IsWindow( HWND ))
5. Move dialog controls to the new position i they are valid windows.
Hope it is useful
Thank You
Regards,
Benoy Bose
|
|
|
|
|
Benoy Bose wrote: There is no need to design a layout manager.
Benoy Bose wrote: 1. Get the Client rectangle of the Dialog Box. ( Use: GetClientRect(LPRECT))
2. Calculate the new size of controls.
4. Validate whether the dialog controls are valid window ( Use; IsWindow( HWND ))
5. Move dialog controls to the new position i they are valid windows.
Which is what the layout manager will do for you.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
Layout manager in Java ( Like you said ) will automatically resize the controls in the window.
Since we have a very simple method to resize the controls in MFC, designing a layout manager is overhead to the developer.
In Java it's depends upon the personel interest since there are both the features are readly available.
|
|
|
|
|
Benoy Bose wrote: Layout manager in Java ( Like you said ) will automatically resize the controls in the window.
Not always. It depends on the way you design it.
Benoy Bose wrote: Since we have a very simple method to resize the controls in MFC, designing a layout manager is overhead to the developer.
Now imagine she want's to change the layout! Imagine the overhead.
Benoy Bose wrote: In Java it's depends upon the personel interest since there are both the features are readly available.
That is why you must have a layout manager. When you design, generalize your design. That is what OOP is all about.
If you don't want any layout don't call the layout manager. I love the Java layout manager classes.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
its really depends upon the persnel interest. I respect you interest. I believe Layout can generalize the functionality, but my code do the same in simple and a few lines.
While I was working with layout managers in Java, i feel i have only a less freedom to move the control over the window. And I satrted to put NULL in the Java Window layout and moved my controls independently.
|
|
|
|
|
Benoy Bose wrote: my code do the same in simple and a few lines.
Then that is called a simple layout manager. Don't get overrawed by the term Layout Manager.
Benoy Bose wrote: i feel i have only a less freedom to move the control over the window.
I worked in Java for sometime. The LayoutManagers were cool. Some of them were not that good but then they all had some purpose as indicated by their name.
I worked in some MFC layout managers. All of them were real cool. Except for setting them up. Once that pain is over it looks real cool.
But as you said it depends.
Nibu thomas
A Developer
Programming tips[^] My site[^]
|
|
|
|
|
I Even want to increase/decrease the size of the controls based on th ewindow size. How can i do this??

|
|
|
|
|
You can either use Layout Managers or simple use MoveWindow or SetWindowPos in OnSize( WM_SIZE )
|
|
|
|
|
|
Thanks a lot.
I got it.
|
|
|
|
|
you can use WM_SIZE and use functions MoveWindow or SetWindowPos in this event
whitesky
|
|
|
|