VB6 - background

Hello,
I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?

Comments

  • : Hello,
    : I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?
    :

    Use the Timer control.

    Greets...
    Richard

  • : : Hello,
    : : I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?
    : :
    :
    : Use the Timer control.
    :
    : Greets...
    : Richard

    Thanks, but where do i put the code in VB6, which event ? I'm not too sure about the structure of faceless background applications....
    :
    :

  • : : : Hello,
    : : : I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?
    : : :
    : :
    : : Use the Timer control.
    : :
    : : Greets...
    : : Richard
    :
    : Thanks, but where do i put the code in VB6, which event ? I'm not too sure about the structure of faceless background applications....
    : :
    : :
    :
    :

    To 'hide' your window, set the Visibility property to false.
    To check every thirty seconds, but a Timer control on the form and set it's Interval to 30000. Then, handle the Timer event.

    Greets...
    Richard

  • : : : : Hello,
    : : : : I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?
    : : : :
    : : :
    : : : Use the Timer control.
    : : :
    : : : Greets...
    : : : Richard
    : :
    : : Thanks, but where do i put the code in VB6, which event ? I'm not too sure about the structure of faceless background applications....
    : : :
    : : :
    : :
    : :
    :
    : To 'hide' your window, set the Visibility property to false.
    : To check every thirty seconds, but a Timer control on the form and set it's Interval to 30000. Then, handle the Timer event.
    :
    : Greets...
    : Richard
    :
    :
    Therefore, I can simply put this code in Private Sub Form_Load()?
  • [b][red]This message was edited by dokken2 at 2005-5-10 5:52:0[/red][/b][hr]
    : : : : : Hello,
    : : : : : I have written a little pgm in VB6, which works as follows. When I click on the command button, my pgm uses API's to get the current 'in focus' windows handle (Hwnd) and displays it in a mesage box. Its just a few lines of code in the command1 click event. I want to run this pgm as a background application so that it doesn't rely on me clicking any button to get it to work and every 30 secs gets the current 'in focus' window handle and displays it in a msgbox. Perhaps VB6 is not the best langage to use and I should use java for this type of code ?
    : : : : :
    : : : :
    : : : : Use the Timer control.
    : : : :
    : : : : Greets...
    : : : : Richard
    : : :
    : : : Thanks, but where do i put the code in VB6, which event ? I'm not too sure about the structure of faceless background applications....
    : : : :
    : : : :
    : : :
    : : :
    : :
    : : To 'hide' your window, set the Visibility property to false.
    : : To check every thirty seconds, but a Timer control on the form and set it's Interval to 30000. Then, handle the Timer event.
    : :
    : : Greets...
    : : Richard
    : :
    : :
    : Therefore, I can simply put this code in Private Sub Form_Load()?
    :


    Your code to use the API to get the window handle would go in the timer event:

    Private Sub Timer1_Timer()
    'my code to run on timer interval every 30 seconds
    End Sub

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories