Lock Mouse in primary screen [closed] - c#

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have an application which use secondary monitor to display content. I dont want user to move curser to secondary monitor. I need to restrict the user to use mouse in primary monitor only. How can i do this.
Thanks

The following article describes creating a global hook: Global Hook (code project)
I think this is closer to what you're asking because you wouldn't want to continuously poll with GetCursorPos() function, mentioned in the other answer. However, using the hook and the MouseMove event handler, I would use SetCursorPos() to keep it within bounds.
Cheers,
Jonno

http://pinvoke.net/default.aspx/user32/GetCursorPos.html
http://pinvoke.net/default.aspx/user32/SetCursorPos.html
Use PInvoke to import the calls from the library and simply check the cursor position and adjust accordingly. You might need the resolution size of the monitor to check if it's within the bounds of the first or second screen.

Related

Scrape data from ActiveX Component [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
With C#, is it possible to basically take in an activex object and get the data out of it? I have a call queue monitor thats an activex object, and I want to implement an alert system for my team, but I cant figure out how to get the data out of the ActiveX component.
If the component doesn't provide a specific way to do it, then probably not easily. If the data is in controls on the screen (like in a window somewhere) then you can possibly use win32 functionality (FindWindow, GetWindowText, so pInvoke) to locate the controls that have the data. You'd need to use Spy++ to find the controls in the window and determine their Class Name and Window Name to do the FindWindow.
Here's one example from SO:
Capturing data from a window in a closed-source third-party Win32 application

How to set a custom mouse cursor for external application window? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have "process_name.exe" and want to set a custom cursor for main window of that process (which is NOT a .net managed application).
You cannot change another application's cursor. Each application controls its cursor. Imagine if somebody went around changing your application's cursor.
Unity 4 is going to have hardware cursor support (available in the Unity 4 beta right now), so if you can wait around for that, don't worry about 3.5 software cursor issues too much.
From http://unity3d.com/unity/beta/notes:
New Cursor API was introduced:
Cursor API supports both software and hardware cursors.
Support for hardware cursors on the following platforms: Windows, Mac OS X, Linux, Flash.
Configure the default cursor in your projects’ Player Settings.
Or if you need a solution rightaway, I believe there is a hardware cursor script being sold in the Unity Asset Store currently.

Finding a hidden Button [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I played in the past on partypoker and worte my own window arranger. it arranged the windows based on a visible button, but today i switched to a different room.
the problem is that i cant find the button with spy++. spy++ doesnt recognize that there is a button. some buttons are findable with spy++, but not the one i need
any ideas how i can find this hidden button ?
If the button is not an actual button (i.e., if it's drawn through code rather than using the standard Win32 button control) you're not going to be able to find it with Spy++. It won't be an actual window, so it won't have a window handle. Thus, you're also not going to be able to click it through the normal mechanisms, like sending it a BM_CLICK message.
It's possible that they're doing this as a security feature, but it's also quite likely that this is part of the growing trend away from using the native UI controls, one that I very strongly disagree with and whose motivations I seriously question.
Your only hope is probably UI automation, which is very tricky to get right. Make sure to test the program in a virtual machine so the world doesn't end when you inevitably click the wrong thing accidentally.

tooltip catcher c# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I want to create an application which can copy the tool tip (the tool tips which are shown on the current desktop/window) if I press hot keys. So how can I track whether the current desktop having a tool tip.
First, its not possible to use the Managed.Net API to access windows in other applications so you will have to do somthing a bit different.
I guess you could use the Win32 API to enumerate windows and find those of the class Tooltip_Class32. Then you'd have to read the text on them.
You can enum windows as described on SO here and on PInvoke.net here.
If you limit to just the Tooltip_Class32 then you will only get the tool tip windows.
I'm not sure how windows contructs a tool tip. I'm guessing you can read the text from the tool tip or from some child control window by using the SendMessage API with the WM_GETTEXT message like here.
That should get you started, I've never actually done it myself but it seems feasible.

Problem in moving images in C# [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I asked a question about moving images with timer in c# . Some people said to me to use WPF. But I never worked with WPF before. I looked msdn but don't understand it.
Please help me, I really need this soon.
I would suggest you to have a look at Expression Blend video tutorial. Learning and implementing wpf without out tools like Expression Blend is quite challenging. http://expression.microsoft.com/en-us/cc197141.aspx
In short, in WinForms (I assume you use WinWorms when you don't use WPF) to animate some elements on the screen, so the following:
Override the forms OnPaint method, and inside there, draw the image(s) on the desired positions.
Make a backgroundworker tat support sending progress.
In the backgroundworker calculate the new positions, then call ReportProgress.
In the report progress event method, redraw the images on their new positions.
Remember to set the forms DoubleBuffered property to true so that the redrawing is done smoothly.
Good luck! :)

Categories