Issues with Magnification API - c#

I am having issues with the Magnification API provided my Microsoft. This is an API that is written in C++ so to use it with C# you must use a series of .dll imports as described in this question.
My issue came after I had the magnification working. I was using my mouse to magnify a predefined area of the screen, the magnification was set in a rectangle, the rectangle filled a WinForm, I placed the form on top of my mouse (mouse in center of form), and the form would follow my mouse around the screen.
About 80% of the time, the app will launch with a black screen. I tried many different types of updates but can't find a fix. The magnification will not show up, it will only show a black screen. Nothing on the from will show up, only a black screen. In summary, only a black screen will show up, BECAUSE of the Magnification API.

The problem has to deal with Windows 32 and 64 bit systems. There's a Forum post about this problem.
I changed the Build of my project from x86 to Any CPU - fixed the problem, no coding needed.
In Visual Studio 2010: In the Solution Explorer right click your project > choose Properties > choose the Build tab > and under Platform Target choose "Any CPU".

Related

click on green pixel on screen, c#

I'm getting a system Message in a SAP Software sometimes. This Software is be opened automatic from a c# wpf tool. I got this green hook at the bottom of the Message. Is it possible to find the green pixels on the screen and perform a mouse click on it when it apears?
You can't control how many green pixels where will be on-screen so while technically finding green pixels, positioning the mouse and simulating clicks is possible, you should probably not do this.
I'd suggest to look for Accessibility markers that you can use to identify these UI elements (you can do this with Accessibility Insights for example) and then use tools like AutoHotKey to automate your interaction.

How do I get the position of Windows Toolbars in C#?

I've been tasked from my workplace to create a program which, when ran, moves the cursor to over a Windows Toolbar within the Taskbar, and left-clicks it.
The rationale for this is that everyone’s using the same mapped Toolbars on their desktop and considering how tiny the button is to activate the dropdown, and how often we’re clicking on it, it becomes tedious.
I’ve made code to move the mouse cursor to a hardcoded location on the taskbar and send the left-click message, and it works pretty fantastically actually.
The reason why the above approach won’t work however is because everyone’s Toolbars are constantly changing locations (variable number mapped apps on taskbar, docking/undocking laptop from large monitors).
The only thing that’s constant is the name of the mapped Toolbars. What I really need is to determine the screen coordinates for Toolbar “x”, and then move the mouse cursor to that.
I have honestly researched this for some weeks now, looking into UI Automation (people C# one of this is deprecated but not C++), and several other related posts, but with no success. I’ve found a C++ solution, but it didn’t actually include a code example (says “do this, then do that”); plus I’m not as- proficient in C++.
Through Spy++ I’m able to see the coordinates, window handle, etc. for these Toolbars, which leads me to believe this must be possible. FindWindow won’t work because the window handle isn’t constant.
Any help you can provide on this is greatly appreciated.

devDept Eyeshot - ViewportLayout/Viewport only shows a black screen on application start

Our windows forms application makes use of devDept Eyeshot for visualization of meshes.
I am getting user reports saying that whenever the application starts and prepares the viewport, only a black screen is presented. Other controls from the UI, such a labels and buttons, display and function correctly.
Of the following image, we should be able to see the left side. Some users report are only seeing the right side.
Viewport
When dragging the form around, the black screen flickers and it is clear that the viewport is still present behind this black screen.
However, it seems impossible to regain control over the viewport and make it display elements without dragging the form around.
Around 10% of our users encounter this problem, which does make it a significant problem.
I have tried to replicate the problem on numerous identically set-up virtual machines, where again approximately 10% of VMs have this problem.
I have no further clues on how to get rid of this annoyance, so any help would be very much appreciated.
Solutions tried:
- Updated graphics card driver -> No effect
- Updated BIOS -> Fixes the problem for a few users, but is not a reliable fix
- Resizing or moving the screen seems to solve the problem. However, the viewport seems unstable and sometimes reverts to the 'black-screen' state.
Details:
- version devDept: devDept Eyeshot v9
- builds are made by using Visual Studio 2013
PC configuration(on which this problem occurs):
- x64 builds
- both Debug & Release
- Windows 7 + Windows 10

How to disable full screen exclusive mode?

I have a computer with Windows 7. I have got 3D simulator installed. This simulator provides window. I want to place transparent window on top of simulator's window (with my extra drawing).
Problem is that simulator's window switches to "full screen exclusive mode" on mouse click. That makes hardware work faster. But that hides the rest of windows (even topmost) including mine transparent window.
Is the a way to disable full screen mode?
This is very interesting post (and it is related to my question):
Detect if user has any application running in fullscreen
Here is a little tip from me: if you are using Presagis Vega Prime then you can switch full screen exclusive mode on and off using acf-file (Full Screen checkbox at Pipeline\Window).
In my case I switched Full Screen off and configured Coordinates so result 3D simulator's window still covers full screen ("fake" Full Screen Mode).
After that there are no problems with my transparent window.

alignment is not getting proper in different resolution

i am working on visual studio 2010.
i created my master form windows state is Maximized
my system resolution is 1366X768 ,,in one button click i am calling 5 forms together into my master form.. but in my system everything getting correct..
but i installed the same application in my client system,,that system resolution is 1024X768
but here my alignment is not getting proper..now my image is getting like this:
so how i can fit my windows form application in all resolution,,if any one know please help me to find out
You basically have two options:
1) Follow Microsoft's instruction on implementing auotscaling for Windows forms applications. (See http://msdn.microsoft.com/en-us/library/ms229605(v=vs.110).aspx)
2) Write your own code to scale the form based on resolution.
============================
Other factors to keep in mind.
If you app is translatable that can affect scaling
A user changing the Windows default font size can have the same affect.
Hope this helps.

Categories