flyingleaf's blog

象外行一样思考,象专家一样实践。

Supporting mouse wheel events do work in the Visual Basic 6.0 IDE

coolbean | 30 八月, 2007 11:01

SYMPTOMS

You cannot scroll by using the mouse wheel in the Microsoft Visual Basic 6.0 IDE.

Back to the top

CAUSE

This problem occurs because the Visual Basic 6.0 IDE does not have built-in support for scrolling by using the mouse wheel.

Back to the top

WORKAROUND

To work around this problem, use one of the following methods:

Method 1

Download the VB6 Mouse Wheel.exe file that includes the add-in DLL and the code that is used to create the add-in DLL.
1.Download the VB6 Mouse Wheel.exe file. The following file is available for download from the Microsoft Download Center:
DownloadDownload the VB6MouseWheel.EXE package now. (http://download.microsoft.com/download/e/f/b/efb39198-7c59-4ace-a5c4-8f0f88e00d34/vb6mousewheel.exe)

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/) How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
2.Click Start, click Run, type regsvr32 <path>VB6IDEMouseWheelAddin.dll, and then click OK.
3.Start Visual Basic 6.0.
4.Click Add-Ins, and then click Add-in Manager.
5.In the Add-in Manager list, click MouseWheel Fix.
6.Click to select the Loaded/Unloaded check box, and then click to select the Load on Startup check box.
7.Click OK.
You can also build the add-in DLL in Visual Basic 6.0. If you do this, the add-in DLL is automatically registered. You can then follow steps 4 through 7 to enable the add-in DLL. To build the add-in DLL, click Make VB6IDEMouseWheelAddin.dll on the File menu.

Method 2

Return to an earlier version of Microsoft IntelliPoint software. To do this, follow these steps:
1.If the IntelliPoint software that is installed on your computer is version 4.9 or a later version, remove the IntelliPoint software from your computer.
2.Install IntelliPoint software version 4.12. The following file is available for download from the Microsoft Download Center:
DownloadDownload the IntelliPoint 4.12 package now. (http://www.microsoft.com/downloads/details.aspx?FamilyID=4348502a-61be-4072-abe2-e3fc3aa0eee6&amp;amp;amp;DisplayLang=en)

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 (http://support.microsoft.com/kb/119591/) How to obtain Microsoft support files from online services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help prevent any unauthorized changes to the file.
Note You can also use this add-in in most VBA environments. Install the add-in as described earlier, create a .reg file with the following values, and merge it with your registry.

Windows Registry Editor Version 5.00

HKEY_CURRENT_USERSoftwareMicrosoftVBAVBE6.0AddinsVB6IDEMouseWheelAddin.Connect
"FriendlyName"="MouseWheel Fix"
"CommandLineSafe"=dword:00000000
"LoadBehavior"=dword:00000000
Note These keys may be ignored if you put them under HKEY_LOCAL_MACHINE.

Back to the top

STATUS

This behavior is by design.

Back to the top

MORE INFORMATION

Mouse wheel support in Visual Basic 6.0 is a function of the mouse driver. The WM_MOUSEWHEEL message is sent to the Focus window when you rotate the mouse wheel. Because the Visual Basic 6.0 IDE does not have built-in support for scrolling by using the mouse wheel, the IDE ignores the WM_MOUSEWHEEL message. However, IntelliPoint software version 4.12 provides mouse wheel support and converts the WM_MOUSEWHEEL message to WM_SCROLL. IntelliPoint software version 4.9 and later versions do not have this feature. Therefore, if you want to use the mouse wheel to scroll in the Visual Basic 6.0 IDE, you must use IntelliPoint software version 4.12.

Back to the top

REFERENCES

For additional information about WM_MOUSEWHEEL notification, visit the following Microsoft Developer Network (MSDN) Web site:
http://msdn2.microsoft.com/en-us/library/ms645617.aspx (http://msdn2.microsoft.com/en-us/library/ms645617.aspx)
For more information, click the following article number to view the article in the Microsoft Knowledge Base:
828675 (http://support.microsoft.com/kb/828675/) The wheel on the mouse scrolls at a slower rate after you install the Microsoft Desktop Elite keyboard

添加BitMap到Menu

coolbean | 29 八月, 2007 05:12

在Window API中,有一些名词要先清楚,假设有一功能表如下:

档案   编辑 选项  --> hMenu    (功能表)
      +-------+
      |复制   |---------> hSubMenu (子功能表)
      |贴上   |
      |减下 -------------> MenuID   (功能表项目)
      |       |
      +-------+

如果,我们使用vb的功能表编辑器做出上面的Menu,那 hMenu的取得使用GetMenu() API
,而hSubMenu 的取得是 GetSubMenu,而GetSubMenu()的第二个叁数指的是功能表的第
几个子功能表,以上例来说,编辑子功能表是第1个子功能表(以0为基准),所以编辑子
功能表的取得应用以下的呼叫 :

hMenu = GetMenu(Me.hwnd)
hSubMenu = GetSubMenu(hMenu, 1) '取得编辑子功能表的hSubMenu

而功能表项目则由以下的呼叫取得,第二叁数指的是该子功能表的第几个项目(以0
开始),故复制 功能表项目 = 0  减下 = 2

MenuId = GetMenuItemID(hSubMenu, 0) '取得复制 的hMenuId

接着便是以ModifyMenu来更动MenuId成BitMap的方式

Set Pic1 = LoadPicture("E:cli.bmp")
ModifyMenu hSubMenu, 0, MF_BITMAP Or MF_BYPOSITION, MenuId, pic1.Handle

ModifyMenu 第二个叁数  表示更动hSubMenu所指的子功能表中第几个功能表项目
   第三个叁数  MF_BITMAP 表示用BitMap的方式显示
       MF_STRING 表示用字串方式显示
       MF_BYPOSITION 表示第二个叁数的值代表是依位置来算
   第四个叁数  MenuId
   第五个叁数  显示图的hBitMap

另外,如何做到MenuItem的左方有一小Bitmap,右方仍是字串呢,使用以下的API

SetMenuItemBitmaps(

    hSubMenu as Long ,    // handle of 子功能表
    uItem    as Long ,    // 更动第几个Menu Item
    fuFlags as Long,    // menu item flags
    hbmUnchecked as Long,  // handle of unchecked bitmap
    hbmChecked as Long    // handle of checked bitmap
   )

Set Pic2 = LoadPicture("e:cli2.BitMap")

Call SetMenuItemBitmaps(hSubMenu, 1, MF_BYPOSITION,pic2.Handle, Pic2.Handle)

这里有一个地方要特别注意,到底hbmUnchecked/hbmchecked 所指的BitMap图有多大呢,
如果pic2所放入的BitMap太大,那不会出现我们想要的图,那得自己想办法缩图;而使
用以下的API可以取得Menu Item左边Bitmap图的大小(By Pixels)

i = GetMenuCheckMarkDimensions
wd5 = i Mod 2 ^ 16  '宽
hi5 = i / 2 ^ 16    '高

而我们Load进来的图之宽 Me.ScaleX(pic2.Width, vbHimetric, vbPixels)
    高 Me.ScaleY(pic2.Height, vbHimetric, vbPixels)

於是呢,我写了一个GetBitMapHandle 来取得hbmUnchecked/hbmchecked所需的BitMap
Handle,而且该hBitMap所指的图,大小刚好是系统内定的大小,而不必在乎原始的图
有多大,当然了,一定要使用BitMap图,不可使用icon/gif等之类的图,这是什麽原
因呢,这是因为我使用StdPicture物件来开启图形档,如果图形档是BitMap图,那麽,
stdPicture物件的Handle属性便是hBitmap。
而要看得懂我GetBitMapHandle的程式,首先请先查阅我另一篇文章Memory Dc与hBitmap
 (查看全文)

VB:如何监听打开的窗口和程序

coolbean | 29 八月, 2007 04:15

         这个问题是CSDN网友MattHgh (黎明破晓前)提出来的,这个问题其实有很多种解决的办法,这里我用WH_SHELL钩子解决,WH_SHELL钩子可以获得很多信息,比如窗口创建、窗口销毁、窗口被激活、窗口的标题栏被重绘等等,但是这些信息都是基于窗口的,而MattHgh 希望同时获得相应的程序。那么怎么根据窗口的句柄的句柄获得对应的程序路径呢,这个当然可以通过枚举所有的进程获得,不过这样一来,速度就慢上一些了,我在程序中用到的是另外一种方法,这种方法尽管很平常,但我估计有些朋友可能还不知道,所以下面我用程序简单的说明一下:

'根据窗口句柄获取对应的程序路径,只适用于NT平台
Public Function GetEXEFromHandle(Optional ByVal nHWnd As Long = 0) As String
    Dim nProcID As Long
    Dim nResult As Long
    Dim nTemp As Long
    Dim lModules(1 To 200) As Long
    Dim sFile As String
    Dim hProcess As Long  '
    If nHWnd = 0 Then nHWnd = GetForegroundWindow()
    '获得窗口的ProcessID
    If GetWindowThreadProcessId(nHWnd, nProcID) <> 0 Then
        '打开Process,获得窗口对应的进程句柄
        hProcess = OpenProcess(PROCESS_QUERY_INFORMATION Or _
        PROCESS_VM_READ, 0, nProcID)
        If hProcess <> 0 Then
            ' 获得窗口对应的Module
            nResult = EnumProcessModules(hProcess, lModules(1), _
              200, nTemp)
            If nResult <> 0 Then
                 '获得程序名
                sFile = Space$(260)
                nResult = GetModuleFileNameEx(hProcess, 0, sFile, Len(sFile))
                sFile = LCase$(Left$(sFile, nResult))
                GetEXEFromHandle = sFile
            End If
            '关闭Process
            CloseHandle hProcess
        End If
    End If
End Function

        请注意函数开始时的注释,这种方法只适用于NT平台,所以用win9x的朋友还是老老实实的枚举进程吧,这样的代码在网上很容易找到,这里我就不罗嗦了。
        下面说说WH_SHELL钩子,MSDN上对这个钩子的描述是这样的:

 (查看全文)

文本操作快捷键,VB6.0 默认快捷键选项

coolbean | 29 八月, 2007 01:02

下列快捷组合键可在文本编辑器中用于在打开的文档中删除、移动或者格式化文本。

命令 快捷键 说明

编辑.分行

Enter Shift + Enter

插入一个新行。

编辑.折叠到定义

Ctrl + M,Ctrl + O

自动确定在代码中创建区域(如过程)的逻辑边界,然后隐藏它们。

编辑.注释选定内容

Ctrl + K,Ctrl + C

使用编程语言的正确注释语法将代码的当前行标记为注释。

编辑.删除水平空白

Ctrl + K,Ctrl +

折叠选定内容中的空白,如果没有选定内容,则删除与光标相邻的空白。

编辑.编排文档格式

Ctrl + K,Ctrl + D

按“选项”对话框“文本编辑器”部分中的语言的“格式设置”窗格中的指定,应用该语言的缩进和空格格式设置。

编辑.格式化选定内容

Ctrl + K,Ctrl + F

根据周围的代码行,正确缩进选定的代码行。

编辑.隐藏选定内容

Ctrl + M,Ctrl + H

隐藏选定文本。信号图标标记隐藏文本在文件中的位置。

编辑.插入制表符

Tab

将文本行缩进指定数量的空格,如 5 个。仅在 .NET Framework 设计器中可用。

编辑.剪切行

Ctrl + Y

将选择的所有行(或当前行,如果未选择任何行)剪切到剪贴板。

编辑.删除行

Ctrl + Shift + Y

删除所有选定行或当前行(如果没有选定行)。

编辑.上开新行

Ctrl + Enter

在插入点之上插入一个空行。

编辑.下开新行

Ctrl + Shift + Enter

在插入点之下插入一个空行。

编辑.行转置

Shift + Alt + T

将包含插入点的行移动到下一行之下。

编辑.改写模式

Insert

改写文档中已有的字符,而不是插入字符。仅在文本编辑器中可用。

编辑.停止隐藏当前区域

Ctrl + M,Ctrl + U

移除当前选定区域的大纲显示信息。

编辑.停止大纲显示

Ctrl + M,Ctrl + P

从整个文档中移除所有大纲显示信息。

编辑.交换定位点

Ctrl + R,Ctrl + P

交换当前选定内容的定位点与结束点。

编辑.左缩进

Shift + Tab

将选定行左移一个制表位。仅在 .NET Framework 设计器中可用。

编辑.切换所有大纲显示

Ctrl + M,Ctrl + L

在隐藏和显示状态之间切换所有以前被标记为隐藏的文本部分。

编辑.切换书签

Ctrl + K,Ctrl + K

在当前行处设置或移除书签。

编辑.切换大纲显示展开

Ctrl + M,Ctrl + M

在隐藏和显示状态之间切换当前选定的隐藏文本部分。

编辑.切换任务列表快捷方式

Ctrl + K,Ctrl + H

在当前行处设置或移除快捷方式。

编辑.取消注释选定内容

Ctrl + K,Ctrl + U

从代码的当前行中移除注释语法。

编辑.查看空白

Ctrl + R,Ctrl + W

显示或隐藏空格和制表符标记。

编辑.字转置

Ctrl + Shift + T

对调插入点两边的单词。

视图.显示引用

Alt + F12

执行区分大小写的全字符号搜索并在“查找符号结果”窗口中显示结果。

黑山谷印象

coolbean | 23 八月, 2007 22:51

万盛黑山谷游记

【黑山谷飞瀑】 (查看全文)

Prosubmitter pro this script 1000$

coolbean | 18 八月, 2007 01:18

When an issue of site SE promotion arises, a webmaster has to exchange links with other sites, contacting site owners and going through the tedious process of placing links to other sites on his or her pages over and over again. It takes lots of time and decreases the efficiency of your site due to excessive outward linking. ProSubmitter™ offers a broad range of features including automated posting of ads and links to your site on thousands of blogs, BBS, guestbooks, FFAs and other resources.
ProSubmitter™ can be easily used by novice and expert webmasters.
With ProSubmitter™ the SE positions of your site will improve drastically, as the more sites link to your site, the higher it gets ranked.
ProSubmitter™ is a powerful tool meant to automate the placement of external links on BBS sites, catalogs, FFAs, blogs, guestbooks etc.
There are two methods of submitting your link to blogs, guestbooks and other sites :

Manually fill in the fields on all kinds of sites, spending hours, days and weeks to get the needed results.
Use ProSubmitter™ which does everything you need a THOUSAND times faster and more efficient. The choice is up to you !
Have a look at the brief list of ProSubmitter™ features :

Automated posting of your links to a multitude of guestbooks, BBS, FFAs, blogs, etc....to unlimited sites!
Free database of over 30000 URLs
Use browser simulate system for anonymous Your requests
Use random User agents
Use random Referer sites
Custom URL databases from Google, Yahoo and MSN listings can be created and used
Submitting links to new site types
Collecting, checking and random proxy using
Multiple user profiles
Save bad urls
Save successful submited urls
Log files for requests
ProSubmitter™ is highly usable. Whatever your knowledge is, you can start using ProSubmitter™ right away without any problems !

All users can benefit from our fast and competent support service.
Moreover, you get all the further updates for free! 

home page:
http://www.professional-submitter.com/


Download

 

用等离子体产生3D动画影像[视频]

coolbean | 17 八月, 2007 11:27

了解Linux硬件兼容性

coolbean | 16 八月, 2007 19:06

在电脑上安装GNU/Linux,最大的噩梦是它的硬件兼容性。为了让Linux更容易运行,我们需要好好评估这些电脑配件:显卡、声卡、打印机、扫描仪、数字照相机、无线网卡、移动设备。linux.com的这篇文章详细的介绍了Linux的硬件兼容情况。在过去的10年里,Linux硬件支持其实有了很大的进步,主要的硬件设备如主板、硬盘、键盘、鼠标、DVD光驱、网卡和闪存在Linux下不会产生什么问题。

显卡:私有驱动可以在显卡制造商网站上寻找,开源驱动方面可查看X.org,目前最糟糕的是ATI的驱动,发布速度很慢,bug也非常多,功能也不强。
声卡:有一个简单的声卡兼容列表
打印机:Linux基金会维护了一个打印机兼容性情况数据库
......... 有朝一日企鹅统治桌面,想必就不用这么麻烦了。

北极圈地运动,丹麦起步,下一个中国

coolbean | 16 八月, 2007 19:05

俄罗斯人在北极圈插上一面国旗,宣称拥有主权,加拿大外长对此的回应是:“现在不是15世纪。你不能在世界各地奔走,仅靠插国旗,就说‘我们对这片土地提出领土要求’。”不过现在看来,地球上每一个国家都打算去北极插面国旗。丹麦将派遣一个40人组成的科研小组去收集证据证明北极是格陵兰岛大陆架的一部分。加拿大则计划在那里建立两个军事基地,美国和挪威也提出主权要求。谁将是下一个?瑞典、德国、澳大利亚,还是马尔代夫?实际上,根据官方媒体的反应,下一个很有可能是中国

北京的传声筒表达了对北极的兴趣,批评了俄罗斯的行为,认为北极海底正成为超级强权的新战场,并导致国际间的争夺战,甚至是军备竞赛和军事冲突。事实上中国也算是北极的熟人,2004年中国在挪威的Svalbard群岛上建立了一个科考站——黄河站

大三学生研发软件卖200万元成富豪

coolbean | 16 八月, 2007 19:03

8月上旬,一网站以人民币200万元收购了华工计算机学院大三学生许少煌和他的创业团队共同研发的计算机操作系统007OS,此举成为继广工女大学生斥资 40万元当地产老板之后校园创业大潮中又一“重磅”事件。随着主力研发的技术被收购,他以及创作伙伴们都成为亿聚网员工,毕业后就在此工作。

DNA疫苗也许可治愈多发性硬化症

coolbean | 16 八月, 2007 19:02

多发性硬化症(Multiple sclerosis)是一种严重的,至今无法治愈的神经系统疾病,它会导致出现失明、瘫痪以及其它许多可怕的症状。在最近的研究中,一位加拿大蒙特利尔的神经免疫学专家开发了一类治疗用DNA疫苗。虽然多发性硬化症的发作原因尚未完全了解,现在看来它是自身免疫。如果DNA疫苗确实能够治愈这类自身免疫性疾病,那么也就存在可能性让DNA疫苗去治疗其它自身免疫性疾病像Crohn’s病,湿疹等等。

北京奥运会选择XP

coolbean | 16 八月, 2007 19:01

奥林匹克委员会决定选择Windows XP而非Vista作为主要操作系统。2008奥运会官方赞助商联想将在装有XP的电脑上执行与比赛相关的重要任务,Vista显然又遭受了一次重大挫折,它只被安装在运动员休闲场所,用于网上冲浪。联想主席杨元庆表示,“奥运会需要的是成熟可靠的技术,它不是新技术的试验场。”此外委员会还反对使用无线网络技术,因为它不太安全。联想已经提供了12000台桌面电脑(主要型号ThinkCentre M55),800台笔记本(ThinkpadT60s和昭阳680s),700台服务器(SureServerT350、R360和R520),2000台打印机以及其它5000台用在运动员休息室或用于接待和营销目的。

Ubuntu的服务器被黑

coolbean | 16 八月, 2007 19:00

Ubuntu不得不关闭部分由Canonical赞助的服务器,8台服务器中的5台正在攻击其他系统。 Canonical责备社区的团队没有好好维护服务器,而社区则说由于Canonical捐的服务器的网卡问题和内核兼容性问题而迟迟没有升级系统。应该说,在这次的问题中两方面都有责任:社区的管理员不注重安全问题,比如未经加密的FTP传输,没有正确维护系统等。而Canonical应该注意他们的服务器上托管着什么。如果分发给用户的的文件已被感染,那样问题就大了。

P.S. 不能不说cnBeta的编辑很强,竟然无中生有能知道这是中国黑客干的,并引起国内媒体的转载,实在让国人争辉不少。

用等离子体产生3D动画影像

coolbean | 16 八月, 2007 18:58

这不算新新闻,/.报道,日本产业技术综合研究所(Japan's National Institute of Advanced Industrial Science and Technology)开发了一种设备能利用激光在空气中生成出真正的3D影像。激光透过透镜对准仪器上方的空气,加热空气中的氧分子和氮分子使之等离子化,由于等离子体会在短时间内持续发散,因此通过移动焦点就能产生真实的3D动画。随着技术的进步,未来它可用于展示街头招牌或广告。视频

盗版软件对自由软件的冲击有多大

coolbean | 16 八月, 2007 18:56

为什么人们不愿意为省钱而去选择免费的操作系统如Linux或BSD,他们似乎对此毫无兴趣,一个重要的原因在于他们认为Windows是免费的。至少,这是一种十分普遍的看法:由于捆绑(预装)和盗版。捆绑是一个众所周知的问题,它影响了人们接受开源操作系统。盗版问题又有多严重,就看你认为“Windows值多少”。
 
Accessible and Valid XHTML 1.0 Strict and CSS
Powered by LifeType - Design by BalearWeb