Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > API > send enter key or chr(13) to the external form or messagebox


Reply
 
Thread Tools Display Modes
  #1  
Old 06-19-2003, 01:20 AM
shweta shweta is offline
Newcomer
 
Join Date: May 2003
Posts: 4
Default send enter key or chr(13) to the external form or messagebox


i am using third party control in my application. that is a .ocx file. when i run the application everytime it shows messagebox / form, when i press enter then it goes ahead with the application.

how can i send enter key through code. so that i dont need to press enter every time.

is it clear ??
shweta
Reply With Quote
  #2  
Old 06-19-2003, 03:15 AM
anomaly's Avatar
anomaly anomaly is offline
Contributor
 
Join Date: Sep 2001
Location: Florida
Posts: 517
Default

PopupHwnd will be the handle of the button

Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long Private Const WM_CHAR = &H102 Call SendMessage(PopupHwnd,WM_CHAR,13,0&)
__________________
So let it be written. So let it be run.
Reply With Quote
  #3  
Old 06-19-2003, 04:23 AM
shweta shweta is offline
Newcomer
 
Join Date: May 2003
Posts: 4
Default Sending enter key

thx ! but its not working.

Where should i call the the function sendmessage. becaz even if i call it in form_initialize event it fires the message box.
do i need to mention the command button name. because i dont know the name of the button or the message box

please help me yaar !!
shweta
Reply With Quote
  #4  
Old 06-19-2003, 07:35 AM
Csharp's Avatar
Csharp Csharp is offline
Senior Contributor

* Expert *
 
Join Date: Jul 2003
Location: Ashby, Leicestershire.
Posts: 967
Default

Code:
Private Declare Function BringWindowToTop Lib "user32.dll" (ByVal hwnd As Long) As Long Private Sub Command1_Click() BringWindowToTop hWnd '/// THE OTHER APPLICATIONS HANDLE. SendKeys "{ENTER}"'/// send the enter key to that window to close the messagebox. End Sub
in that instance i had a seperate application open with a messagebox saying "loaded!" , then from my vb project i clicked Command1 and closed the messagebox.
hope that helps.
__________________
~~ please don't PM me regarding code, I only reply to personnal messages ~~
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multi connections, one port? burningodzilla Communications 5 08-02-2005 05:04 PM
how to put enter key in an external messagebox shweta API 1 06-19-2003 12:19 AM
MDI Form and dimensions kkonkle Interface and Graphics 6 03-26-2003 09:50 AM
WinSock vbsupernewbie Communications 1 09-12-2001 10:20 PM
Create a new form similar to an existing form ric General 6 07-17-2001 12:47 AM

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->