|
// AppBarDemo.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "AppBarDemo.h"
#include "MainFrm.h"
#include "AppBarMngr.h"
/////////////////////////////////////////////////////////////////////////////
// CAppBarDemoApp
BEGIN_MESSAGE_MAP(CAppBarDemoApp, CWinApp)
//{{AFX_MSG_MAP(CAppBarDemoApp)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAppBarDemoApp construction
CAppBarDemoApp::CAppBarDemoApp()
{
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CAppBarDemoApp object
CAppBarDemoApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CAppBarDemoApp initialization
BOOL CAppBarDemoApp::InitInstance()
{
CMainFrame* pFrame = new CMainFrame;
m_pMainWnd = pFrame;
// creates a simple frame, without caption, icon or menu
pFrame->Create(NULL, "AppBarDemo", WS_POPUP);
// avoid taskbar button to appear, also removes 3D edge
pFrame->ModifyStyleEx(WS_EX_APPWINDOW|WS_EX_CLIENTEDGE, WS_EX_TOOLWINDOW);
// Don't show, AppBar Manager class will do
pFrame->ShowWindow(SW_HIDE);
pFrame->UpdateWindow();
// Create AppBar manager thread
CAppBarMngr *appbar = (CAppBarMngr *)::AfxBeginThread(RUNTIME_CLASS(CAppBarMngr));
// Init AppBar Manager, right sided
int result = appbar->Init(pFrame->m_hWnd, 150, false);
// Check if hooking has been successful
if (result==APPBARHOOK_SUCCESS)
return TRUE;
else if (result==APPBARHOOK_DLLERROR)
::AfxMessageBox("Error loading AppBarHook.dll");
// else should be APPBARHOOK_ALREADYHOOKED, close application
return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// CAppBarDemoApp message handlers
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.