发信人: lightsabre() 
整理人: skyice(1999-11-10 07:43:13), 站内信件
 | 
 
 
如何使程序不在任务栏上显示任何东西? 要求不改变应用程序标题栏样式,如仍然要保持有最大化、最小化按钮等  
  I suggest you create a SDI and use Form View  for your application. Then create an invisible  window as the parent of your Frame Window. 
  class CMainFrame...  { 
  CWnd m_wndOwner;  }; 
 
  BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)  {  //modified this function to use our owner 
  if (!CFrameWnd::PreCreateWindow(cs))  return FALSE; 
  //end of changed lines 
  //added these lines to create our invisible owner 
  // we have to check since PreCreateWindow may be called  // more than once 
  if (m_wndOwner.m_hWnd == NULL)  {  // we don't care about any attributes of our hidden window 
  LPCTSTR pstrOwnerClass = AfxRegisterWndClass(0); 
  if (!m_wndOwner.CreateEx(0, pstrOwnerClass, _T(""), WS_POPUP,  CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,  NULL, 0))  return FALSE;  } 
  // note that we _don't_ set WS_CHILD... making the _owner_  // window of our frame some invisible window. 
  cs.hwndParent = m_wndOwner.m_hWnd;  return TRUE; 
  //end of added lines  } 
  CMainFrame::~CMainFrame()  {  //added these lines to destroy our invisible owner when we're done 
  if (m_wndOwner.m_hWnd != NULL)  m_wndOwner.DestroyWindow(); 
  //end of added lines  } 
  ※ 来源:.月光软件站 http://www.moon-soft.com.[FROM: 4.54.50.192]
  | 
 
 
 |