If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Delphi, C etc > Form SetFocus

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-01-04, 02:58
Madhivanan Madhivanan is offline
Registered User
 
Join Date: Oct 2003
Posts: 357
Form SetFocus

Hai,
I am developing a VB Application. I want to make it visible and invisible according to the records in the table. I use MS Access2000. I use a table which has the field Signature which is of type OLE Object which I use it to store images. I load that image in the inkdata control and do screen capture and update the status of that record as captured. I am doing this in a timer event. My idea is that if there is no record to be captured the application should be invisible and if new record is added then it should become visible and capture the image and become invisible. This works well. But the problem is that after becoming invisible,the focus is not in the application if the application becomes visible. I have to click the application icon in the status bar to make it focus. Is there a way to make it focussed?

Thanks for any helps
Madhivanan
Reply With Quote
  #2 (permalink)  
Old 07-05-04, 09:06
SCIROCCO SCIROCCO is offline
Registered User
 
Join Date: Mar 2004
Location: www.scirocco.ca
Posts: 346
You must use an API call. Here is a code example:

Code:
Private Const SWP_SHOWWINDOW = &H40

Private Declare Function _
        FindWindow Lib "user32" Alias "FindWindowA" _
        (ByVal lpClassName As String, _
        ByVal lpWindowName As String) As Long

Private Declare Function _
        ShowWindow Lib "user32" _
        (ByVal hwnd As Long, _
        ByVal nCmdShow As Long) As Long

Private sub LooseFocus()
    AppHandle As Long

    AppHandle= FindWindow(vbNullString, "Calculator")
    ShowWindow AppHandle, SW_SHOWNORMAL
End Sub
__________________
http://www.scirocco.ca/images/banner...occobanner.gif

Download for FREE the ADO/DAO Data Controls that makes life EASIER developing database applications in: VB, FoxPro, Access, VC++, .NET etc... Navigate, Add New, Delete, Update, Search, Undo and Save your changes. Supports Disconnected Recordsets and Transactions!

Or try our Ask An Expert service to answer any of your questions!
Reply With Quote
  #3 (permalink)  
Old 07-06-04, 01:20
Madhivanan Madhivanan is offline
Registered User
 
Join Date: Oct 2003
Posts: 357
Thanks for your reply. When I am working with other applications the VB application window is not in focus. Still I have a problem.

Madhivanan
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
Pingbacks are On
Refbacks are On