← Back to team overview

sikuli-driver team mailing list archive

[Bug 1292336] Re: [1.1.0.] WinUtil.cc: suggestions for enhancements and fixes

 

** Changed in: sikuli
    Milestone: 2.0.0 => 2.1.0

** Changed in: sikuli
   Importance: High => Medium

** Summary changed:

- [1.1.0.] WinUtil.cc: suggestions for enhancements and fixes
+ [check] WinUtil.cc: suggestions for enhancements and fixes

-- 
You received this bug notification because you are a member of Sikuli
Drivers, which is subscribed to Sikuli.
https://bugs.launchpad.net/bugs/1292336

Title:
  [check] WinUtil.cc: suggestions for enhancements and fixes

Status in Sikuli:
  In Progress

Bug description:
  focusWinByAppName in WinUtil.cc attempts to use
  GetWindowModuleFileName() to search for applications by executable
  name but there are multiple bugs in that function:

  1. GetWindowModuleFileName() only works for windows owned by the
  calling process (i.e. Sikuli itself):
  http://support.microsoft.com/?id=228469

  2. GetWindowModuleFileName() returns a fully-qualified path, and I
  think looking for a substring in this path is not a good idea. Instead
  it should look at executable filename only, i.e. the last component of
  the path.

  3. focusWinByAppName does not initialise the "filename" variable and
  it does not check to see whether GetWindowModuleFileName() succeeded
  or failed, so when it fails the "filename" variable is uninitialised.

  One consequence of this is that if I run Sikuli from a path containing
  the word "Foo" and then I try to call App.focus('Foo') with the
  intention of focusing an application with that word in the title bar,
  Sikuli may set the focus to the wrong window, depending on the order
  of windows returned by EnumWindows().

  I am using Sikuli IDE 1.0.1 on Windows Server 2008 R2 (64-bit).

To manage notifications about this bug go to:
https://bugs.launchpad.net/sikuli/+bug/1292336/+subscriptions


References