Jiangsheng的CSDN Digest(March 4, 2006)(8)

王朝other·作者佚名  2006-03-10
宽屏版  字体: |||超大  

WebBrowser1的问题(VB 基础类)

用WebBrowser1来浏览硬盘上的文件列表,可是,双击文件夹就会打开新窗口,如何让它在当前窗口下打开文件夹

浏览器控件显示文件夹视图(例如本地目录或者FTP站点)时在其中双击目录,选中的目录会用新的资源管理器窗口打开的问题,是因为浏览器控件中的文件夹视图在打开文件夹的时候并不触发浏览器的NewWindow2事件,而是调用ShellExecuteEx,用DDE的方式和Shell通讯。微软知识库文章Q189634 WebApp.exe Enables User to Move WebBrowser Ctrl(http://support.microsoft.com?kbid=189634 )描述了如何处理这样的DDE会话。

怎么让一个窗体在点“X”的时候是隐藏,而不是关闭?(.NET技术 C# )

this.Closing += new

System.ComponentModel.CancelEventHandler(this.Form1_Closing);

private void Form1_Closing(object sender, System.ComponentModel.CancelEventArgs e)

...{

// Hide the form...

this.Hide();

// Cancel the close...

e.Cancel = true;

}

必须判断用户是不是要关闭整个程序,否则子窗口永远不关闭,程序就没办法正常退出。

CTreeCtrl 如何用SetItemData使Item保持额外数据? (VC/MFC 界面 )

You should not delete the item data when it is being used by an item;

handle TVN_DELETEITEM to delete the itemdata when it is no longer used.

BTW, you need to reconsider if you need a tree control at all. Tree control sends several messages for each item. Destroying 40,000 items entails 40,000 TVN_DELETEITEM notifications. Just by sheer numbers that's going to take a while. 40,000 items in a treeview is unusably excessive.

Suggest reading:

http://www.codeproject.com/treectrl/waitingtreectrl.asp

问个MFC中document/view结构的问题(VC/MFC 基础类)

CDocTemplate管理document、view、frame,对吧?我现在想创建一种新的文件类型,用自己的程序打开,但这中文件中,记录的只是一些有用的信息,不需要view 和frame窗口,就有点儿象 dsw文件那样。这种情况要怎么实现?也就是说实现的document 不绑定view 和frame。

It is much easier to edit the registry directly. See http://support.microsoft.com/kb/257592/ and http://msdn.microsoft.com/msdnmag/issues/1100/c/default.aspx

To implement custom registration code using MFC classes you needed to override CDocManager::RegisterShellFileTypes().

Unregistration is a bit more complicated, because the corresponding functions in CWinApp and CDocManager were not declared virtual. Therefore, you needed to implement the correct code in an override of CDocManager::UnregisterShellFileTypes(), and copy and paste the code from CWinApp::UnregisterShellFileTypes() and CWinApp::ProcessShellCommand() in our own CWinApp-derived class.

To implement file operations transparently, you overrode CDocManager::DoPromptFileName() and CDocManager::OpenDocumentFile(). To minimize the number of changes, the global function MatchDocType() has been defined to replace the use of CDocTemplate::MatchDocType() member function. The new function behaves as expected when multiple extensions are provided for one document template.

reference:

http://www.codeproject.com/shell/cgfiletype.asp

如何用activex关闭网页(VC/MFC ATL/ActiveX/COM )

call window.close from the activex

see

How To Retrieve the Top-Level IWebBrowser2 Interface from an ActiveX Control

http://support.microsoft.com/kb/257717

INFO: Accessing the Object Model from Within an ActiveX Control

http://support.microsoft.com/kb/172763

第一页    上一页    第8页/共8页    下一页    最后页
第01页 第02页 第03页 第04页 第05页 第06页 第07页 第08页 
 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
© 2005- 王朝网络 版权所有