🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: cn.bbs.comp.program
1 messages
1 total messages Started by �ϵ� Sun, 19 Apr 1998 00:00
����������
#1107
Author: �ϵ�
Date: Sun, 19 Apr 1998 00:00
123 lines
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

--
�� ��Դ:���ϴ�С�ٺ���Ϣ����վ bbs.nju.edu.cn��[FROM: a507yjh.nju.edu]
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads