Category: Uncategorized
-
Extend a webbrowser control using ICustomQueryInterface
Begin ChatGPT generated response To extend a WebBrowser control using ICustomQueryInterface, you can create a new class that implements the ICustomQueryInterface interface and then use the SetSite method of the WebBrowser control to set the new class as the site for the control. Here are the steps you can follow: Create a new class that…
-
New web server hijacker HttpResetModule.dll
Today a friend’s server was hacked. The web site displays normally if visited directly. The content is highjacked when visit from a Baidu Search result, similar to what user 41nbow experienced at https://www.freebuf.com/articles/web/222060.html. A file system wide search for recent changed files shows that %windir%\system32\inetsrv\config\applicationHost.config file was recently updated. New entries were added to the…
-
Better Late Than Never
This post originally appeared on Joycode on Sept 17 2004. 在文件选择对话框和浏览器中都可以显示文件夹视图,但是有时需要对显示的方式进行控制,例如在文件选择对话框初始化时设置显示方式为详细资料视图或者缩略图视图,有的时候需要用程序来选择一些项目,例如在文件选择对话框中添加全选按钮,或者打开文件所在文件夹并且选中指定文件。 我在大约一年之前的一个Post(http://blog.joycode.com/jiangsheng/archive/2003/11/09/6152.aspx)中提及到这个问题,搞定了之后一直忘记公布答案了,今天在CSDN社区看到别人问的类似问题才想起自己已经解决了,所以现在拿出来分享…… 关于如何设置文件夹视图的显示方式的问题,Paul DiLascia在他的MSDN杂志C++Q&A专栏中提供了另一个解决方案。参见List View Mode, SetForegroundWindow, and Class Protection(http://msdn.microsoft.com/msdnmag/issues/04/03/CQA/)。PS:这家伙又用Spy++大法…… 浏览器控件显示文件夹视图(例如本地目录或者FTP站点)时在其中双击目录,选中的目录会用新的资源管理器窗口打开的问题,是因为浏览器控件中的文件夹视图在打开文件夹的时候并不触发浏览器的NewWindow2事件,而是调用ShellExecuteEx,用DDE的方式和Shell通讯。微软知识库文章Q189634 WebApp.exe Enables User to Move WebBrowser Ctrl(http://support.microsoft.com?kbid=189634)描述了如何处理这样的DDE会话。呃……顺便说一下,这篇文章文不对题…… 下面的给出访问文件打开/保存对话框和浏览器控件的文件夹视图的代码(MFC) #ifndef WM_GETISHELLBROWSER#define WM_GETISHELLBROWSER (WM_USER+7)//差不多一年过去了,这个消息还是a yet-to-be documented message#endif void CCustomFileDialog::OnInitDone(){CFileDialog::OnInitDone();//Remember, when you customize the open file dialog,//your CFileDialog is actually a child of the real dialog,//which explains…
-
Converting generic OopFactory.X12 structures to typed counterparts
OopFactory.X12 can parse EDI messages into segments and loops. However despite typed segments and loops exist, the parser does not generate them in the object model. The unit test only use them when generating EDI messages. The typed segments and loops are aggregative objects that do not contain their own data members besides the contained…
-
How To Determine When a Page Is Done Printing in WebBrowser Control
Note this post is originally written in 2012. It was lost when moving my web site from Windows Live Spaces to WordPress. I found a dead link to my web site on Stackoverflow and found an archive from archive.org. So here it is the old article, with dead link updated of course. The printing from…
-
Troubleshooting a memory leak
Got called into a memory leak troubleshooting. The application was leaking memory at 1mb per second. In memory profiler, most of the growing memory are used by byte[] and RuntimeMethodHandle (growing at around a million per minute). Initially I thought it is a disposing problem, but the memory occupied by disposable objects does not increase…
-
Icepocalypse 2021 冰狱 2021
this is my dairy about the winter storm occurred in Feb 2021. 这是我2021年二月冬季风暴的日记 Feb 13 Sat. 27-30F. Stockpile food (glad I did it). Heard ice building on roads, so instead I shopped on foot. Almost fell because of invisible ice. 2月13日周六 –3-1度。储粮(幸好我这么做了)。听说路上在结冰所以我走路去买菜。还是有看不见的冰,差点摔倒。 Feb 14 Sun. 12-30F Stay home. Freeze warning, keep water dropping. Listened to…
-
微软拼音卡顿的问题
微软拼音最近每次激活的时候都要卡上个几分钟。而且不是一个程序只卡一次,中英文切换之后还会继续卡。 用了Process Monitor跟踪了一下,发现每次切换中英文的时候,微软拼音都会在%appdata%\Microsoft\InputMethod\Chs下面创建一个名字为UDPXXXX(这里XXXX是16进制数字).tmp的文件,我这个目录下有六万五千多个这样的文件。从命名风格来看,很明显是在调用GetTempFileName,而这个函数有65535个文件的限制,不删除文件的话,第65536次调用会失败,应该是微软拼音没有处理好调用这个函数失败的情况,也没有删除临时文件的代码,就卡住了。 目前的绕过这个问题的方法是把 del %appdata%\Microsoft\InputMethod\Chs\*.tmp /q 加到每日备份脚本。 已经向微软反映了这个问题。不知道微软为什么临时文件不放%TEMP%放应用程序目录下,以及为什么不定期清理自己创建的临时文件。
-
Today’s fake email of the day
Today’s fake email of the day Hi Dear, How are you doing hope you are fine and OK? I was just going through the Internet search when I found your email address ……. So you care about an article titled “Trap CtrlAltDel; Hide Application in Task List on Win2000/XP” in 2020 and downloaded its source…
-
Fix sphinxcontrib-googleanalytics on Sphinx 1.8
The Google Analytics extension from python -m pip install sphinxcontrib-googleanalytics does not work on Sphinx 1.8. When I run it, I get the following error Could not import extension sphinxcontrib.googleanalytics (exception: cannot import name ‘ExtensionError’ from ‘sphinx.application’ (c:\python37\lib\site-packages\sphinx\application.py)) Fix is to change C:\Python37\Lib\site-packages\sphinxcontrib\googleanalytics.py Line 4 from from sphinx.application import ExtensionError to from sphinx.errors import ExtensionError…