|
thank you for the answer, but i have one question: how can i use the planified task (windows) with this program
|
|
|
|
|
|
I'm implementing a OO framework for the Win32 User Interface. The normal stuff like creating windows and so forth doesn't seem to be a problem, but hanling the messaging is.
I have a base Control class that does all the CreateWindow, font settings and other general stuff. Then I derive other controls from it, just setting the classname for the class to a something else to create a specific kind of control, like setting the classname to BUTTON, creates a button control. This works fine, but I still have to do the WM_COMMAND processing in the Window/Frame Control. I'd like to do this in the derived control class. I've tried chaining that derived control's WNDPROC's, but when trying to retrieve that specific object through a GetWindowLong ( GWL_USERDATA ) doesn't work, as the control that has the original WNDPROC is set in the USERDATA variable..
I'm pretty stuck ... hope you understand what I mean. I'll post some code if you don't understand.
Thanx
|
|
|
|
|
tiaanl wrote: I'll post some code if you don't understand.
Quite interesting. Go ahead.
Nibu thomas
Software Developer
|
|
|
|
|
Only have code on home machine , but it looks something like this:
class Control {
public:
virtual bool Create ( Control *parent );
protected:
virtual bool CreateHandle ( void );
virtual bool SetParams ( void );
}
bool Control::Create ( Control *parent )
{
SetParams ();
CreateHandle ();
}
bool Control::CreateHandle ( void )
{
handle = CreateWindowEx ( ... )
SetWindowLong ( handle, GWL_USERDATA, this );
}
bool SetParams ( void )
{
style = WS_CHILD | WS_VISIBLE;
classname = "STATIC";
}
This is a stripped down skeleton of it and when I want to create a derived control I do this:
class EditControl : public Control
{
virtual bool SetParams ( void );
}
bool CEditControl::SetParams ( void )
{
classname = "EDIT";
}
Boom! Edit control. Same with a buttons, list views, tree views, etc.....
For a actual window control, I derive a CustomControl class which adds some registration methods to register a new window class with WNDPROC etc....
Now here's the problem: I add eg. EditControl as a member in MainWndControl and run the create with MainWndProc as the parent. That window has it's own WNDPROC, and I do a GetWindowLong ( GWL_USERDATA ) inside the wndproc to get a pointer to the actual MainWndControl. Then I add some WM_COMMAND message handling in there to do what the buttons and edit controls is supposed to do. This is fine, but what I want to do is add message handling to specific Control classes to handle things like WM_PAINT, WM_LBUTTONUP, WM_FOCUS and that kind of generic messages.
This is where I tried chaining the WNDPROC's, but the Control receiving the message isn't the Control that has to get processed, because the GWL_USERDATA is set to something else.....
|
|
|
|
|
Are you looking for something like THIS[^]?
Maxwell Chen
|
|
|
|
|
Looks really promising - will have a go at it and give some feedback....
Thanx a million
|
|
|
|
|
what is the best way to learn COM ?
|
|
|
|
|
For beginners - Michael Dunn's articles on COM.
Start here[^]
Nibu thomas
Software Developer
|
|
|
|
|
Thank u Thomas That article is so nice.
|
|
|
|
|
Krishnatv wrote: Thank u Thomas That article is so nice.
You should read on. He has written these articles in a series. Like Part - 1, Part - 2.
Nibu thomas
Software Developer
|
|
|
|
|
I want to load bitmap on dialog box,using bitmap buffer and not willing to save it(bimap buffer) as file.Can any one please help!!!!!!!!
Thanks in advance
Rahul
|
|
|
|
|
For loading a bitmap from a resource use LoadBitmap and from a file use LoadImage .
Nibu thomas
Software Developer
|
|
|
|
|
(Nibu thomas :
For loading a bitmap from a resource use LoadBitmap and from a file use LoadImage.)
and CImage and OleLoadPicture for read graphic files
|
|
|
|
|
HI Guys,
I have created a dialog and placed two buttons on it with the owner draw property set to true to show the bitmap on it using LoadBitmaps.On the dialog I have placed a picture control with some image.
Now when I run the application the picture control is seen with the buttons behind it. When I take the mouse to the location of the buttons the buttons become visible.
I want the button to be shown as soon as the dialog is displayed.
What is the problem and how can it be resolved?
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
This is because the picture control is overlapping the buttons.
The last control that gets painted here is the picture control hence it paints over the buttons.
Nibu thomas
Software Developer
|
|
|
|
|
|
|
Are you making a splash screen?
If so why don't you simply BitBlt to the dialog.
If not bring the buttons up the Z-Order using SetWindowPos .
Nibu thomas
Software Developer
|
|
|
|
|
Thanks for your time guys.
But I got how to do this.
I would like to share the solution with all of you.
Set the Transparent property of the button to TRUE . That is all.
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
How to call a java class from win32 api?
|
|
|
|
|
|
and why would you do such a thing ?
a java class is compiled for byte code, not for processor assembler...
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
And I think also that java code needs a virtual machine no ? (I don't know java so I'm not sure at all).
|
|
|
|
|