Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Having my HWND and eating it, too...
Re: Having my HWND and eating it, too... [message #12102 is a reply to message #12095] |
Wed, 10 October 2007 23:06 |
|
tvanriper
Messages: 85 Registered: September 2007 Location: Germantown, MD, USA
|
Member |
|
|
I understand that... but it was exactly the clue I needed to fix my problem.
It's a little gnarly, but my control now works mostly the way I want it to work (I need to fix a small problem related to positioning, but it's close).
I needed to create a new control derived from Upp::Ctrl. This control has a constructor (for no real reason, I could probably have ommitted this), and an 'Initialize' function that takes an HWND (the 'owner' HWND) and a Rect (the size of the window to create).
Initialize then calls Upp::Ctrl::Create( HWND owner, WS_CHILD | WS_VISIBLE, 0, false, SW_SHOW, true ) to create the HWND.
I then added a member variable of this class in my control.
When I need to initialize the HWND, I call my new class's Initialize() function, which creates the necessary HWND of exactly the type I needed.
I'm able to feed this HWND into the functions I'm using, and it's painting to the area (except for being slightly above it... something I'm trying to fix now).
All-in-all, it works, but not quite as elegantly as I had hoped. It's still sufficiently U++-like (I think) to be acceptable.
|
|
|
|
|
Having my HWND and eating it, too...
|
|
|
Re: Having my HWND and eating it, too...
By: Oblivion on Wed, 10 October 2007 21:56
|
|
|
Re: Having my HWND and eating it, too...
|
|
|
Re: Having my HWND and eating it, too...
By: Oblivion on Wed, 10 October 2007 22:31
|
|
|
Re: Having my HWND and eating it, too...
|
|
|
Re: Having my HWND and eating it, too...
By: Oblivion on Wed, 10 October 2007 22:50
|
|
|
Re: Having my HWND and eating it, too...
|
|
|
Re: Having my HWND and eating it, too...
By: Oblivion on Wed, 10 October 2007 23:11
|
|
|
Re: Having my HWND and eating it, too...
|
|
|
Re: Having my HWND and eating it, too...
|
|
|
Re: Having my HWND and eating it, too...
By: mirek on Fri, 12 October 2007 00:09
|
Goto Forum:
Current Time: Thu May 16 03:27:24 CEST 2024
Total time taken to generate the page: 0.02161 seconds
|