Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Child WIndow without MDI!!! 13

Status
Not open for further replies.
Vow!

vb5programmer deserves all the stars. He is the one who lighted the fire..

Thanks vb5
 
Niphyr

I like your webpage, its ligth :), good design.

--
Luis MX
 
VBSun,

In your comment...
I just figured out that the picture preview option in commondialog boxes can be implemented via the setparent.

How would you do that???

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
This is the idea.

Create a dialog and store the handle.

Add a form to the project and place a picturebox in there.

Use MoveWindow to streach the dialog.

Use setparent to set the parent of the picturebox in the form to the dialog.

Use movewindow to place the picture box to where you need in the dialog. (Note you can add as many controls and place it in the extended area. A flexgrid, listbox, richtextbox to preview textfiles and docs..)

Subclass these messages.

WM_DESTROY = &H2
WM_NOTIFY = &H4E
WM_NCDESTROY = &H82
WM_GETDLGCODE = &H87
WM_INITDIALOG = &H110
WM_COMMAND = &H111
CDN_INITDONE = (CDN_FIRST - &H0)
CDN_SELCHANGE = (CDN_FIRST - &H1)
CDN_FOLDERCHANGE = (CDN_FIRST - &H2)
CDN_SHAREVIOLATION = (CDN_FIRST - &H3)
CDN_HELP = (CDN_FIRST - &H4)
CDN_FILEOK = (CDN_FIRST - &H5)
CDN_TYPECHANGE = (CDN_FIRST - &H6)
CDN_INCLUDEITEM = (CDN_FIRST - &H7)

When ever you get a CDN_SELCHANGE message, you can show the picture preview by loading the picturefile in to the picturebox. Changed filename can be selected by using GetComDlgFileName API.

This the logic. The actual programming is left to interested readers.
 
Hmmmm... Well...

Looks like you managed to spark my imagination...

How do you execute code while a dialog box is open?
Does the CDN_SELCHANGE raise an event... or do you have to create an event???

Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif

 
Thats what subclassing is all about..

You hook, intercept the window messages, optionally define your own actions while receiving each message...
 
Nicely done vbSun ... have another
star.gif
on me ...
 
Thanks Vb5..
 
Hey guys, I think this can be used as tabstrip.

I cant find a good sample using tabstrip in VB6, but I will use this code.

Or... any other sugestions???

Thanks.

--
Luis MX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top