Code question

Started by Rex,

Rex

Anyone know how to add that "dragging" capability to my program, just like XMPlay when it drags the playlist-window to the right? I would be real grateful if someone helped me out with this!

Thanks in advance, Rex.

WinWon

Hm, I think you should use the SendMessage() API to do that.

Rex

Please can't someone atleast give me an idea/suggestion on how to do that?

DanaPaul


QuoteAnyone know how to add that "dragging" capability to my program, just like XMPlay when it drags the playlist-window to the right?

This isn't the forum for such a question.  However, I personally feel that XMPlay does a good job with this functionality rather than other media applications that utilize a timer and a scrolling portion of a window size.  I loathe timers and waiting for anything so boring, eh? :)

You would need to process wm_MouseDown messages and re-calculate window/control width(s) while using API SetWindowPos to adjust sizes on the fly.

Rex

Heh well you're right and I'll use a subclass that will handle WM_LBUTTONDOWN messages to try to do it :)

Thanks, Rex.

Sebastian Andersson

You should use SendMessage(hwnd,0xA1,15,0); to complete that task I think. Hope it works :D

DanaPaul


QuoteYou should use SendMessage(hwnd,0xA1,15,0); to complete that task I think. Hope it works :D

Actually, "Send" message would not bring a desired effect, and may cause an infinite loop.  "Post" message on the other hand would have the calling function returning without waiting for a result. For that reason, I believe you will find that a combination of wm_ButtonDown and wm_MouseMove processing would allow you to size the window using SetWindowPos (no wm_Messages!) without causing the app to hang or loop infinitly.

Rex

Yeah, maybe if I use PostMessage instead of SendMessage it will work. Btw DanaPaul you got any sample code or something that I can start to build/work from? The code can be in any language.

Thanks to everyone of ya, Rex.

DanaPaul


QuoteBtw DanaPaul you got any sample code or something that I can start to build/work from? The code can be in any language.

Generally, this code will be spread out amongst many methods/handlers.  But any Splitter control (dynamically re-size controls) or header control (dynamically re-size Columns) should give you a good starting point and an example that is specific to your visual object oriented language (if any).

Ian @ un4seen

The way it's done in XMPlay is with multiple windows (ie. one for each panel) = no resizing/reshaping involved, just moving, which is of course quicker and simpler... the real tricky bit is the Z-ordering of the windows :)

DanaPaul


QuoteThe way it's done in XMPlay is with multiple windows (ie. one for each panel) = no resizing/reshaping involved, just moving, which is of course quicker and simpler...

The playlist window could never be any wider than the main window, eh?

Quotethe real tricky bit is the Z-ordering of the windows :)

API SetWindowPos has a parameter for z-ordering flags :)


Rex

Thanks to all of ya :) Heh I could never figure out it used multiple windows lol :P Well I hope I'll get it working ;) Thanks again :)

Rex.

Ian @ un4seen

QuoteThe playlist window could never be any wider than the main window, eh?
Yep. But that's actually a good thing, as it allows skin designs where the side panels show through spaces in the main panel.

QuoteAPI SetWindowPos has a parameter for z-ordering flags :)
Yep, but Windows likes to move them around once you start clicking on them, so you have to keep enforcing the order... the fun really begins when you add other windows/dialogs into the mix :)

Ralesk

... and when Windows decides to choke on a handful of alwaysontop windows and meass around with window orders just for the hell of it :P