|
-
June 11th, 2012, 07:55 AM
#1
Own Windows shell replacement - help in OOP
I'm writing my own shell replacement for Windows 7 and 8 (32 & 64bit). This is my hobby and I do this program for personal use only.
Currently I have done (in 90% - small issues left) reverse-engineering of the system tray. Now i'm trying to create the taskbar. Unfortunately I don't know how to create objects and how to set relationships between them. It's mostly about message management and the drawing.
I have base class called CWindow which provide basic functionality of window-controls and windows with title bar. My taskbar class called CTaskbarWnd is a class derived from CWindow. CTask is a base class having information about a task.
At the moment I decided to create a separate class, which will be used to draw the buttons. Object of this class through a pointer will access to information about the task. CTaskbarWnd will use this class to draw specific button.
I mean something like that:
Code:
CTask *pBtnTask;
WM_PAINT:
hDC = BeginPaint(hWindow, &ps);
iter = taskList.begin();
while (iter < taskList.end())
{
pBtnTask = (*iter);
pTaskBtnPainter->PaintBtn(hDC, &pBtnTask);
iter++;
}
EndPaint(hWindow, &ps);
break;
Or maybe it would be better if each of these buttons will be a window, which itself will be painted?
I am asking for help because I want to do it in right way, I mean OOP.
By the way - is there someone who has experience in creating their own shell and would be willing to help?
-
June 13th, 2012, 02:53 AM
#2
Re: Own Windows shell replacement - help in OOP
I would stick to idea of creating buttons as windows. And they will be able to paint themself.
As for me, having a separate class only for buttons painting is not the best solution. Painting is more an action than an object. In theory, any class should represent some real object or entity.
-
June 19th, 2012, 03:21 PM
#3
Re: Own Windows shell replacement - help in OOP
Ok, thanks for the advice, I did it exactly in this way. My taskbar is fully working now
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|