Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old April 25th, 2006, 02:04 PM
Registered User
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default not recognized


I used the code below but it isnt be recognized by vb.net 2003
What do i wrong??
(the code must let me able to give sendkeys in my webbrowser)

VB doesnt recognize the line: Imports System.Windows.Forms

Thanks for your reply


   ' must have this in order to use the SendKeys function
    Imports System.Windows.Forms
    Public Class WinControl

        ' This is the function used in order to block the keyboard and mouse:
        Declare Function BlockInput Lib "User32" _
               (ByVal fBlockIt As Boolean) As Boolean
        ' This function will block the keyboard and mouse untill a window with
        ' the specify caption will appear or the given time in seconds has
        ' past ( 0 seconds - wait forever).
        ' If the window with the caption appears than the given key is send
        ' to it and the input block is removed.
        Public Shared Function Wait2Send(ByVal caption As String, _
                  ByVal keys As String, ByVal seconds As Integer)

            ' Indicates if the window with the given caption was found
            Dim success As Boolean = False

            ' Start time of the function
            Dim now As DateTime = DateTime.Now

            ' Begining of keyboard and mouse block

            While (success = False And (DateTime.Now.Subtract(now).Seconds _
                                                   < seconds Or seconds = 0))
                    ' Activating the window with desired function
                    ' if the window is not found an exception is thrown.

                    ' Sending desired key stroke to the application window

                    ' Indicates the window was found and keys sent
                    success = True

                    ' Assuming window was not found and sleep for 100 miliseconds
                End Try
            End While
            ' Release the keyboard block

        End Function

Similar Threads
Thread Thread Starter Forum Replies Last Post
ruby is not recognized.... Crippy RoR Ruby on Rails 1 July 16th, 2008 08:37 AM
Database changes not recognized until restart semilemon C# 5 April 26th, 2006 06:19 PM
MSXSL is not recognized as an internal or external GLSmyth XML 2 October 6th, 2005 10:36 AM
'net' is not recognized as a command ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 7 December 20th, 2004 02:31 PM
ch15: can't get JSTL to be recognized brownale2k JSP Basics 1 August 8th, 2003 04:32 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.