Article View: cn.bbs.comp.program
Article #1107����������
From: �ϵ�
Date: Sun, 19 Apr 1998 00:00
Date: Sun, 19 Apr 1998 00:00
123 lines
5747 bytes
5747 bytes
������: kkk (��), ����: Windows
�� ��: ����������
����վ: '3m�Ͻ�ɺ�m' (Sun Mar 29 13:27:00 1998) , վ���ż�
����������
�?˾����
ժҪ
�����Ӧ�ó����У�����ܻ�ϣ��Ӧ�ó���ı�
���������������������û�����ij�ֲ��������Ľ�����
���ʹһ�����ڵı���������������
����������
����һ�����ڵı�������ζ�Ÿı���ı���������ۣ�
������ӻ��Ϊ��������ǴӲ����Ϊ��ȵȡ�
ֻҪ������Visual Basic�еõ����ڵľ����Ϳ���
ʹ��Windows Ӧ�ó����̽ӿڣ�API��������ʹ�ô�
�ڵı�������������������FlashWindows���Ա���ʹһ
���ض��Ĵ�������һ�Ρ�Ҫʹ�øú�����Ҫ�����µ�
������������Ĵ����ͨ�����������У�
#If Win32 Then
Declare Function FlashWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bInvert As Long) As Long
#Else
Declare Function FlashWindow Lib "User" ( _
ByVal hwnd As Integer, _
ByVal bInvert As Integer) As Integer
#End If
�ú�����Ҫ2�������һ��������Ҫ�����������Ĵ�
�ڵľ��ڶ�����������ָ�������ô��ڵ�����״
̬�����ǻָ���ԭʼ״̬������bInvert�����0��
��������ڵı����������������ò���Ϊ0�������
���ڵı��������ָ�Ϊԭʼ״̬��
�ú�����ص�ֵ����ָ�����øú���ǰ���ڵ�״̬��
���÷���ֵ��0������������ڵ��øú���֮ǰ�ǻ�
���ģ���������ֵΪ0����������ú���ǰ����
�Ƿǻ�ġ�
��ʹ�ø�FlashWindow����ʱ��һ���Ϻõķ����ǽ���
����������Ƶ������Ϊͬ���ַ�Ҳ�������Ĺ�꣩
��ͬ�����ַ������Ƶ�ʿ���ͨ����ú���
GetCaretBlinkTime����á�Ҫʹ�øú�����Ҫ����
�µ�������������Ĵ����ͨ�����������У�
#If Win32 Then
Declare Function GetCaretBlinkTime Lib "user32" () As Long
#Else
Declare Function GetCaretBlinkTime Lib "User" () As Integer
#End If
�ú�����ú���ֵ��ʾ��ʱ�䡣
�������
1. ��Visual Basic�п�ʼһ���µĹ��̣�����ȱ
ʡ�ķ�������Form1��
2. ��Form1�����һ����ʱ���ؼ�������ȱʡ��
��������Timer1��
3. �����µĴ�����ӵ�Form1��Form_GotFocus�¼��У�
Private Sub Form_GotFocus()
Timer1.Enabled = False
End Sub
4. �����µĴ�����ӵ�Form1��Form_Load�¼��У�
Private Sub Form_Load()
Timer1.Interval = GetCaretBlinkTime()
Form2.Show
End Sub
5. �����µĴ�����ӵ�Timer1��Timer1_Timer�¼��У�
Private Sub Timer1_Timer()
Success = FlashWindow(Form1.hwnd, 1)
End Sub
6. ��ӵڶ������壬����ȱʡ�ķ�������Form2��
7. �����µĴ�����ӵ�Form2�ĵ����¼��У�
Private Sub Form_Click()
Form1.Timer1.Enabled = True
End Sub
8. ���һ���µ�ģ�飬����ȱʡ�ķ�������
Module1.Bas�������µĴ�����ӵ���ģ���ͨ�����������У�
#If Win32 Then
Declare Function FlashWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bInvert As Long) As Long
Declare Function GetCaretBlinkTime Lib "user32" () As Long
Dim Success As Long
#Else
Declare Function FlashWindow Lib "User" ( _
ByVal hwnd As Integer, _
ByVal bInvert As Integer) As Integer
Declare Function GetCaretBlinkTime Lib "User" () As Integer
Dim Success As Integer
#End If
ͨ���F5�������и����������Form2���壬��
ʱForm1���彫���ڷǻ��ʽ����������������˸��
����Form1ʹ�����Ϊ���ʽ������ı�������������
˸����ͼ1��ʾ��
ͼ1
--
m;36m�� ��Դ:���Ͻ�ɺ� bbs.njupt.edu.cn��[FROM: 202.119.224.86]m
--
[m[1;36m�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: a507yjh.nju.edu][m
Technical Details
Message-ID:
<3OAjQk$tP2@bbs.nju.edu.cn>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: Chinese,GB X-Google-Thread: fc86e,37243a36112413eb,start X-Google-Attributes: gidfc86e,public From: mendy.bbs@bbs.nju.edu.cn (�ϵ�) Subject: ���������� Date: 1998/04/19 Message-ID: <3OAjQk$tP2@bbs.nju.edu.cn> X-Deja-AN: 345980901 X-Filename: Programming/M.893024782.A Organization: nju_bbs Newsgroups: cn.bbs.comp.program