Program behaving differently in Windows 10

I have a program that works fine in Mac OS/X and Windows 7 and 8.1. Now some users in our group have gone onto Windows 10 and the program does not work.

It is just a drag and drop program where the user drops a font file onto the window of the program and some info about the font is displayed. In Windows 10 the program will not accept the font file drop.

I cannot see any specific settings in Xojo for compiling for Windows 10. I am using Xojo 2016 r2.1 on Mac OS/X 10.10.5

I’m at a loss as to what to do next so any help or pointers to resources would be appreciated.

First thing to do is to install Windows 10 in a VM to see what is going on for yourself.

Verify the FileTypes is set correctly for font types. In Mac a simple me.AcceptFileDrop("image/jpeg") can do. Under Windows you must use a FileTypes.

IMHO nothing should go out the door without being tested under the current OS, which happens to be today Windows 10 Creator Edition.

https://www.microsoft.com/en-us/software-download/windows10ISO

You can buy oem licenses on Amazon for very little.

https://www.amazon.co.uk/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=windows+10+oem

Thank you Michel for the info.

We have Windows 10 test machines and can see the problem.

FileTypes are correct.

Windows 10 was not a requirement of the group at the time of development.

Indeed. I have programs that were created for XP that today are on the Windows Store. The market is a moving target. You got to address idiosyncrasies when they present. Although recent developments in Windows 10 do indeed require some efforts, it is a walk in a park as compared to yearly macOS releases.

If you can see the problem on your test machine, you are going to solve that.

Eventually, set FileTypes to special/any and filter dropped folderItem by the extension.

Before I ask for an example program to simulate the problem, could you answer the following?

Give the example program a test in Example Projects\Desktop\DragAndDrop\ListBoxDragAndDrop.xojo_binary_project

  1. Does this work when you drop the font file onto it?
  2. Does this work when you drop a text file onto it?
  3. Where is the font file being dropped FROM (font folder, network share, desktop?)
  4. In your program, when you try to drop the file do you see a RED “no entry” symbol on the mouse pointer?
  5. In your program, when you try to drop the file do you see a BLACK “no entry sign” on the mouse pointer?
  6. Does your application run in elevated mode (as administrator)?

If 5 and/or 6 are YES, I know what the problem is.

Michel and Julien, Many thanks for your replies.

Julian, The answer to 5 is ‘Yes’.

I now believe that Xojo is not the causes of this behaviour, but Inno Setup. if I copy the compiled EXE to Windows 10 test machine, the program will run fine. It is only when the program is ‘installed’ via the Inno installer that this strange behaviour happens.

Still investigating…

The problem is that your application is running under an elevated privilege level, possibly due to a miss-configuration during installation. I.e. your app is running as administrator (high), and Explorer is running at a medium level. This stops drag and drops from explorer to your app.

See here for more information:

https://blogs.msdn.microsoft.com/patricka/2010/01/28/q-why-doesnt-drag-and-drop-work-when-my-application-is-running-elevated-a-mandatory-integrity-control-and-uipi/

I was going to suggest the following link as a remedy:

https://helgeklein.com/blog/2010/03/how-to-enable-drag-and-drop-for-an-elevated-mfc-application-on-vistawindows-7/

It would seem that this isnt possible as I think Xojo uses OLE, which cant be circumvented.

However, fixing the installer might be the way to go, you need to lower the privilege level of you app.

You can see the same problem if you run Notepad as administrator (or Xojo for that matter), you cant drop a text file onto it, however you can do so if you run notepad normally, your program is having the same issue.

As a quick thing to check is the properties on your exe (right click, properties) and go to the Compatibility tab, look in the Settings section and ensure that “Run this program as an administrator” isn’t checked at the bottom of the pane.

But yes, check your Inno installer config, good luck :slight_smile:

PS. It could be where the app is placed, certain folders run as administrator, could be worth checking

PPS. Turning off UAC will also get around the problem, but that might not be wanted, just an option :wink:

Julian, Problem solved!

Many, many, many, many thanks for your wise direction. All that is required is this code added to the Inno Setup:

PrivilegesRequired = Lowest

Windows 10 is now happy to allow drag and drop files to the app.

Many thanks again Julian.