Results 1 to 5 of 5

Thread: give focus to another window

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Cochin, India
    Posts
    350

    Question give focus to another window

    Hi,
    I am using vb.net.
    When my app get focus, How can i know which window had focus before? When my app get focus, I must be able to refocus the previous window(suppose it is a text editor) and paste some text where the cursor is.
    Somebody please let me know how and which api should i use
    DOK OCK : "The power of .net in the palm of my hand, nothing will stand in my way. Nothing."

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: give focus to another window

    When your application gains or loses focus Windows sends the WM_ACTIVATEAPP message, the wParam will then contain the activation flag, TRUE if your application gains focus in which case lParam will contain the thread identifier of the thread that owns the window that is losing focus.

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Cochin, India
    Posts
    350

    Re: give focus to another window

    Can u explain with vb.net code?
    DOK OCK : "The power of .net in the palm of my hand, nothing will stand in my way. Nothing."

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: give focus to another window

    No, cause I'm not using VB.Net. In classic VB you would subclass your form and check for the WM_ACTIVATEAPP message.

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2005
    Location
    Cochin, India
    Posts
    350

    Re: give focus to another window

    then please explain with classic vb code
    DOK OCK : "The power of .net in the palm of my hand, nothing will stand in my way. Nothing."

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width