Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 25th, 2006, 02:04 PM
Registered User
 
Join Date: Apr 2006
Location: Hoorn, NH, Netherlands.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default not recognized

Hi,

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

Simon

   ' 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
            BlockInput(True)

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

                    ' Sending desired key stroke to the application window
                    SendKeys.SendWait(keys)

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

                Catch
                    ' Assuming window was not found and sleep for 100 miliseconds
                    System.Threading.Thread.Sleep(100)
                End Try
            End While
            ' Release the keyboard block
            BlockInput(False)

        End Function




Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 01:31 PM
ch15: can't get JSTL to be recognized brownale2k JSP Basics 1 August 8th, 2003 04:32 PM



All times are GMT -4. The time now is 09:41 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.