SourceCodeSky QQ客服 SourceCodeSky 400电话 客服电话 暂无
首页 » 源代码 » 虚拟桌面 » /frame.cpp

frame.cpp ( 文件浏览 )

文件源自: 虚拟桌面
  • keepall 发布于 2016-08-28 09:36
  • 浏览次数:368
  • 下载次数: 2
  • 下载需 10 积分
  • 侵权举报
/* 
   File: frame.cpp - Implementation of main frame window.

   Implements ZDDesk's main frame window.  This window is never visible it is
   mainly provided to handle tray notification messages and to display the
   context menu and to process menu commands.  It implements the "virtual 
   desk" code for ZDDesk -- i.e. the switching of desktops, etc..

   Author: Steven E. Sipe
   
*/

#include "stdafx.h"
#include "zddesk.h"

#include "frame.h"
#include "splash.h"

#include "tray.h"
#include "registry.h"
#include "arrange.h"
#include "property.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

static const char *ZDDESKKEY = "Software\\PC Magazine\\ZDDesk";
static const int UM_TRAYNOTIFY = WM_USER+2000;

/////////////////////////////////////////////////////////////////////////////
// CZDDeskFrame

BEGIN_MESSAGE_MAP(CZDDeskFrame, CFrameWnd)
   //{{AFX_MSG_MAP(CZDDeskFrame)
   ON_WM_CREATE()
   ON_WM_DESTROY()
   ON_WM_RBUTTONUP()
   ON_COMMAND(IDM_EXIT, OnExit)
   ON_WM_LBUTTONUP()
   ON_COMMAND(IDM_ARRANGE, OnArrange)
   ON_COMMAND(IDM_PROPERTIES, OnProperties)
   ON_COMMAND(IDM_ABOUT, OnAbout)
   ON_COMMAND(IDM_HELP, OnHelp)
   //}}AFX_MSG_MAP
   ON_MESSAGE(UM_TRAYNOTIFY,OnTrayNotify)
   ON_COMMAND_RANGE(IDM_DESK1,IDM_DESK9,OnSelectDesk)
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CZDDeskFrame construction/destruction

// Constructor
CZDDeskFrame::CZDDeskFrame()
{
   // Initialize the virtual desktop
   InitializeDesks();
}

// Destructor
CZDDeskFrame::~CZDDeskFrame()
{
   // Shutdown the virutual desktop
   UninitializeDesks();
}

///////////////////////////////
/// "Safe" utility routines ///
///////////////////////////////

// Performs a ShowWindow() call without locking up on frozen applications.
// Basically, the WM_SHOWWINDOW message generated for each app by ShowWindow() 
// locks the sending app under Windows if the receiving app is dead
BOOL CZDDeskFrame::SafeShowWindow(HWND hWnd, int nShowCmd)
{
   // Determine if the app is still alive or hung
   DWORD dwResult;
   if(::SendMessageTimeout(hWnd,WM_NULL,0,0,SMTO_ABORTIFHUNG,1000,&dwResult))
   {
      // Seemed to work okay --- show the window
      if(dwResult == 0)
         ::ShowWindow(hWnd,nShowCmd);
      return(TRUE);
   }
   else 
   {
      // Skating on thin ice now, don't send anymore color changes
      if(!m_bFrozen)
      {
         // Warn the user about the potential problem
         m_bFrozen = TRUE;
         AfxMessageBox(IDS_FROZEN,MB_ICONWARNING|MB_OK);
      }
      return(FALSE);
   }
}

// Don't set the system colors if we have detected a dead application --
// the WM_SYSCOLORCHANGE message also locks up with dead applications
void CZDDeskFrame::SafeSetSysColors(int cElements, CONST INT *lpaElements,
                              CONST COLORREF *lpaRgbValues)[!==More==!]			
...
展开> <收缩

下载源码到电脑,阅读使用更方便

1 积分

快速下载
还剩0行未阅读,继续阅读
免费下载源码
Sponsored links

源码文件列表

温馨提示: 点击源码文件名可预览文件内容哦 ^_^
...
名称 大小 修改日期
/registry.cpp 3.17 KB 1997-06-30 21:14:32
/property.cpp 4.19 KB 1997-06-30 21:14:32
/arrange.cpp 11.46 KB 1997-06-30 21:14:32
/zddesk.dsp 6.86 KB 1997-05-29 09:39:32
/zddesk.aps 71.35 KB 1997-06-30 21:24:34
/zddesk.rc 10.53 KB 1997-06-30 21:24:34
/resource.h 3.14 KB 1997-06-30 21:14:36
/frame.h 4.61 KB 1997-06-30 21:14:36
/arrange.h 2.16 KB 1997-06-30 21:14:36
/tray.h 1.20 KB 1997-06-30 21:14:36
/registry.h 913 Bytes 1997-06-30 21:14:36
/property.h 1.32 KB 1997-06-30 21:14:36
/zddesk.mak 9.55 KB 1997-06-11 23:49:46
/zddesk.mdp 36.00 KB 1997-06-25 22:26:02
/zddesk.clw 3.26 KB 1997-06-30 21:21:12
/zddesk.dsw 535 Bytes 1997-05-12 20:15:20
/zddesk.plg 1.65 KB 1997-06-02 09:38:16
/splash.h 1.17 KB 1997-06-30 21:14:36
/debug/ 0 Bytes 1997-05-26 17:03:26
/release/ 0 Bytes 1997-05-26 17:03:26
/res/ 0 Bytes 1997-05-26 17:03:26
/stdafx.h 471 Bytes 1997-06-30 21:14:36
/splash.cpp 3.30 KB 1997-06-30 21:14:32
/stdafx.cpp 208 Bytes 1997-06-30 21:14:32
/tray.cpp 2.60 KB 1997-06-30 21:14:32
/frame.cpp 20.43 KB 1997-06-30 21:14:32
/zddesk.h 2.08 KB 1997-06-30 21:14:36
/zddesk.cpp 5.66 KB 1997-06-30 21:14:32
/res/zddesk5.ico 1.05 KB 1997-05-02 22:48:26
/res/zddesk4.ico 1.05 KB 1997-05-02 22:56:50
/res/zddesk3.ico 1.05 KB 1997-05-02 22:43:30
/res/zddesk2.ico 1.05 KB 1997-05-02 22:56:50
/res/zddesk1.ico 1.05 KB 1997-05-02 22:56:50
/res/zddesk9.ico 1.05 KB 1997-05-02 22:55:12
/res/zddesk8.ico 1.05 KB 1997-05-02 22:53:34
/res/zddesk7.ico 1.05 KB 1997-05-02 22:51:36
/res/zddesk6.ico 1.05 KB 1997-05-02 22:49:50
/res/zddesk.ico 1.05 KB 1997-06-11 23:36:14
/res/list.bmp 358 Bytes 1997-05-01 00:39:54
/res/splsh16.bmp 18.09 KB 1997-06-30 21:24:34
/res/zddesk.rc2 397 Bytes 1997-01-30 11:35:14
/res/nodrop.cur 326 Bytes 1997-05-02 22:00:26
/res/drop.cur 326 Bytes 1997-05-02 22:00:26
Sponsored links
正在加载中……

Switch to the English version?

Yes
SourceCodeSky 英文版
No
SourceCodeSky 中文版

完善个人资料,获价值¥30元积分奖励!