Menu

[r76]: / trunk / src / StatusBarMsgWnd.h  Maximize  Restore  History

Download this file

64 lines (52 with data), 1.4 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once
#include "BaseWindow.h"
#include <string>
#include <vector>
using namespace std;
#define STATUSBARMSGWND_SHOWTIMER 101
#define STATUSBARMSGWND_ICONSIZE 32
class CStatusBarMsgWnd : public CWindow
{
public:
CStatusBarMsgWnd(HINSTANCE hInst, const WNDCLASSEX* wcx = NULL)
: CWindow(hInst, wcx)
, m_width(200)
, m_height(80)
, m_icon(NULL)
{
RegisterAndCreateWindow();
}
void Show(LPCTSTR title, LPCTSTR text, UINT icon, HWND hParentWnd, UINT messageOnClick, int stay = 10);
private:
// deconstructor private to prevent creating an instance on the stack
// --> must be created on the heap!
~CStatusBarMsgWnd(void);
protected:
virtual void OnPaint(HDC hDC, LPRECT pRect, UINT uEdge);
/**
* Registers the window class and creates the window.
*/
bool RegisterAndCreateWindow();
/// the message handler for this window
LRESULT CALLBACK WinMsgHandler(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
LRESULT DoTimer();
void ShowFromLeft();
void ShowFromTop();
void ShowFromRight();
void ShowFromBottom();
private:
wstring m_title;
wstring m_text;
HICON m_icon;
UINT m_messageOnClick;
HWND m_hParentWnd;
UINT m_uEdge;
RECT m_workarea;
int m_ShowTicks;
LONG m_width;
LONG m_height;
int m_stay;
int m_thiscounter;
static int m_counter;
static vector<int> m_slots;
};
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.