2 Replies - 11209 Views - Last Post: 06 May 2009 - 10:40 AM Rate Topic: -----

#1 kingtomato117   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 05-February 09

Set Window Focus while using other Active Windows.

Posted 06 May 2009 - 10:00 AM

Im wondering how to set either a focus window or active window or something, but still able to move around in other windows with out my SendKeys function sending keys to any other window. This is the code I have to set the active window to the window I need to sendkeys to:
		Dim targetWnd As Long = FindWindow("ncrwgst1.wal-mart.com - PuTTY", vbNullString)
		SetActiveWindow(targetWnd)
		Timer1.Start()


Now anytime I have like notepad or even my Remedy window up, it sends the keys to that window. Any ideas how to set it where it JUST sends to the targethWnd I have defined and still move around in my other windows?

Is This A Good Question/Topic? 0
  • +

Replies To: Set Window Focus while using other Active Windows.

#2 Luc001   User is offline

  • D.I.C Addict

Reputation: 84
  • View blog
  • Posts: 617
  • Joined: 04-May 09

Re: Set Window Focus while using other Active Windows.

Posted 06 May 2009 - 10:26 AM

View Postkingtomato117, on 6 May, 2009 - 09:00 AM, said:

Im wondering how to set either a focus window or active window or something, but still able to move around in other windows with out my SendKeys function sending keys to any other window. This is the code I have to set the active window to the window I need to sendkeys to:
		Dim targetWnd As Long = FindWindow("ncrwgst1.wal-mart.com - PuTTY", vbNullString)
		SetActiveWindow(targetWnd)
		Timer1.Start()


Now anytime I have like notepad or even my Remedy window up, it sends the keys to that window. Any ideas how to set it where it JUST sends to the targethWnd I have defined and still move around in my other windows?


Hi,

If you mean that you only want to use sendkeys in a target window then I think you can use the Keypreview = True in the properties of that window. Set Keypreview = false in the other windows.
Was This Post Helpful? 0
  • +
  • -

#3 kingtomato117   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 22
  • Joined: 05-February 09

Re: Set Window Focus while using other Active Windows.

Posted 06 May 2009 - 10:40 AM

View PostLuc001, on 6 May, 2009 - 09:26 AM, said:

View Postkingtomato117, on 6 May, 2009 - 09:00 AM, said:

Im wondering how to set either a focus window or active window or something, but still able to move around in other windows with out my SendKeys function sending keys to any other window. This is the code I have to set the active window to the window I need to sendkeys to:
		Dim targetWnd As Long = FindWindow("ncrwgst1.wal-mart.com - PuTTY", vbNullString)
		SetActiveWindow(targetWnd)
		Timer1.Start()


Now anytime I have like notepad or even my Remedy window up, it sends the keys to that window. Any ideas how to set it where it JUST sends to the targethWnd I have defined and still move around in my other windows?


Hi,

If you mean that you only want to use sendkeys in a target window then I think you can use the Keypreview = True in the properties of that window. Set Keypreview = false in the other windows.


How exactly do I do that for windows outside my application? I was able to figure it out for windows part of my application, but not for other windows.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1