ChrisBettencourt

So I'm trying to put a new user interface on an existing piece of software that will limit the user's options. I've tried using sendKeys, etc to basically just operate the program for the user, and only show them what I want them to see. But its looking like the creators of this software really don't want that to happen. Things that work with every other app I have, just don't work on this software. In addition, some of the most crucial funtions of this app can not be accessed without using the mouse.

I'm wondering if there isn't some way to open the original app, and then have a very simple vb app literally sit on top of it. There would probably be nothing selectable on the app that I make. It would have maybe open windows or holes or something, so that the user could still operate the software underneath, but the app that I created would just physically prevent them from clicking on certian options.

One possible snag to this is that the existing app opens up maximized. It can be minimized or closed, but it does not have a resizing function, and it always wants to take the dominant position on the screen, to the point of blocking out the taskbar.

Is this a possible solution to my problem Can it be done in VB Or is there some other solution that I'm maybe just not seeing. (The company said that they would absolutely never release the API)

I'd really appreciate your help. I'm very ready to get this project out of my life.



Re: Visual Basic Language Interface with 'holes'?

kleinma

What you are trying to do is a hack.... not a hack in the bad way, a hack in the sense that it is going to be VERY hard for you to fully accomplish what you are trying to do.

The application (flowcut) simply is not designed with this in mind, and that is what is going to make it so hard for you...

Were you actually given this task by your boss If so are they aware of the type of challenge this is, and the fact that you may simply not be able to accomplish it

If I were you, I would be looking for other cutting software that does offer the ability to set users with certain permissions to do certain things, or one that provides an API to program against...


I only say that because I have seen you posting a bunch all on this same topic, and while I hate to be the one to rain on your parade, I don't think you are going to be able to accomplish this exactly how you want to... Also, what happens when FlowCut 6.5 or 7.0 comes out Will it be back to the drawing board






Re: Visual Basic Language Interface with 'holes'?

ChrisBettencourt

Yea. I know this is a pretty bad situation.

I was given this task by my 'boss'. Basically, I'm a temp who gets hired on to this one company maybe twice per year. My job is to just figure stuff out. They send me from department to department where different people give me projects that they've been working on for months and haven't been able to resolve. I'm supposed to poke around and come up with a solution. I have to admit, this is turning out to be the worst one yet (and I've had some doozies), but I really thought that it would be possible. Their level of awareness ends at the branching of 'Things they can do themselves', and 'Things they can't do themselves'. Beyond that, they really don't know what this sort of thing entails, which is why I'm coming off as being a little stressed.

As far as a new version of FlowMaster coming out, I don't think that will be an issue. This is one program loaded onto one machine attached phsyically to the Water Jet Cutter. They've 'assured' me that they are in this for the long haul. Getting other software or another cutter isn't an option either. I'm not exactly sure why, except for the obvious cost issues, but jumping headfirst into a product and then having all sorts of problems is a common issue for this company.

I'd like to give it one last shot at this if this is an option, even if it is a hack, or if it doesn't end up working. I figure that I can spend until the end of this week looking at this before I need to tell them that its not possible. I think that part of the problem is that I'm not a VB programmer, or a programmer at all for that matter. They just pay me relatively little to do tutorials on their time and figure out this stuff.

If I were to attempt to do the overlay interface, am I looking at just making dialog boxes I know I'm a pain with my many posts, and I assure you I'll be out of your forum soon! Wink





Re: Visual Basic Language Interface with 'holes'?

kleinma

Nah, I don't mind your posts. I only post in them to try to help you. Sorry, I know telling you it's impossible is not really much help....

I suppose if you just wanted to "cover up" certain sections of the form by overlaying on top of it, you could, but that really won't stop the user from doing things... For example, once any control on the flowcut interface has focus, the user could simply hit the tab key to tab through all flowcuts controls even if you have some dialog or form covering it over. Also you have to worry about shortcut keys... lets say you somehow disable a button so they can't click it, but if they hit ctrl+g it performs the action anyway....

See what I am getting at


Tell your "boss" that they are trying to use a bandaid on a gunshot wound






Re: Visual Basic Language Interface with 'holes'?

ChrisBettencourt

I see what you mean about just being able to use the keyboard to do some things. I just opened it up and poked around. While there arent' shortcuts for everything that I want to be able to do, there are plenty of shortcuts for the things I'm trying to disable.

However, I was able to do everything I needed to do by just using the mouse. It wouldn't be the first time that this company took a keyboard away from a user. It would be more like a bandaid and an amputation for that gunshot wound.

How would I get the 'cover up' objects to stay visible while operating flowcut I was thinking about how some programs have error messages that let you keep doing stuff but the box stays visible.





Re: Visual Basic Language Interface with 'holes'?

kleinma

that usually consists of showing a non modal window, but making the window's topmost to true... TopMost is like setting a window to be "always on top" but it doesn't block other things from happening in the given application that called the window...

however if you want them to still be able to do things in flowcut, since that is a seperate process running, you could just call ShowDialog() on the forms in your own app, which shows them modally.

I guess you will have to play around with it and see if any of those scenarios will fit your needs...






Re: Visual Basic Language Interface with 'holes'?

ChrisBettencourt

Ok. I'll give it a shot. Thanks again for the coding and other advice.



Re: Visual Basic Language Interface with 'holes'?

PEng1

Another possibility, while not any easier or less confusing, but entierly possible is to figure out how to communicate with the machine and bypass Flowcut out right.

While I was in college we didn't like the programing software for a certain CNC machine we had so we just wrote our own.

This would be a lengthy project but it would work and it would meet all of your requierments since you can make it do whatever you want.






Re: Visual Basic Language Interface with 'holes'?

michael

Have you thought about using the Windows API to hide the buttons/controls you don't want the users to be able to use I think this would work really well since the window for the application is always full screen and they can't move it around. Try something like this:

Code Snippet

#Region "API Functions" 'Windows API Functions used in the code

Declare Function WindowFromPoint Lib "user32" (ByVal POINT As Point) As Integer

Declare Function ShowWindow Lib "user32.dll" (ByVal hwnd As IntPtr, ByVal nCmdShow As Int32) As Boolean

#End Region

Private HIDECONTROL As Integer = 0

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

'The location of the control on the screen

Dim pt As New Point(517, 490)

'Get the handle of the control

Dim GetCtrlHndl As Integer = WindowFromPoint(pt)

'The StringBuilder is empty because it is just a place holder for the function

Dim sb As New System.Text.StringBuilder("")

'Use the SendMessage API function to hide the control

ShowWindow(New IntPtr(WindowFromPoint(pt)), HIDECONTROL)

End Sub

You will have to use that same section of code for each control you want to hide, but I think this would be the easiest solution to your problem. The hardest part will be figuring out the point on the screen for each control, but this code will tell you the location of the control. Make a new windows application and add a label named "DragBox" and a timer with an interval of 100. Click and drag from the label to the control you want, let go of the mouse when the cursor is over the control, and the last value in the output window of VS will be the location of the control. I hope this helps.

Code Snippet

Private booWaiting As Boolean = False

Private booMouseDown As Boolean = False

Private Sub DragBox_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DragBox.MouseDown

Try

'Change the booMouseDown value, image, and cursor

booMouseDown = True

Cursor.Current = System.Windows.Forms.Cursors.Cross

Catch ex As Exception

MsgBox(ex.ToString)

End Try

End Sub

Private Sub DragBox_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DragBox.MouseUp

Try

'Change the booMouseDown value, image, and cursor

booMouseDown = False

Cursor.Current = System.Windows.Forms.Cursors.Default

Catch ex As Exception

MsgBox(ex.ToString)

End Try

End Sub

Private Sub DragBox_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles DragBox.MouseMove

Try

'When the mouse moves, start the timer if the mouse button is down and the timer isn't already started

While booMouseDown = True And booWaiting = False

booWaiting = True

Timer1.Start()

End While

Catch ex As Exception

MsgBox(ex.ToString)

End Try

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Try

'Stop the timer

Timer1.Stop()

'Get the information about the control the mouse is over

Console.WriteLine(Control.MousePosition)

Catch ex As Exception

MsgBox(ex.ToString)

Finally

'The timer is stopped, so we aren't waiting any more

booWaiting = False

End Try

End Sub






Re: Visual Basic Language Interface with 'holes'?

Frank Carr

You might be able to take my Pseudo System Modal Dialog code example and expand it to deal with this kind of situation. Essentially it uses a nearly transparent topmost form to block user access to the programs below. Making the 'holes' to click through to the form underneath might be tricky though. You might also need code to keep the mask form on top if the other program is also using routines to make itself topmost.

If the target program is using DirectX, this will probably make it impossible to do something like you envision.

Another consideration is that if your users have local admin access they will be able to bypass your security in whatever form it takes. You should lock down non-admin users on these systems if you haven't already.






Re: Visual Basic Language Interface with 'holes'?

jgalley

What about using a local network filter or proxy to intercept calls to the waterjet You might then allow someone to use the program but intercept instructions to do something bad.





Re: Visual Basic Language Interface with 'holes'?

ChrisBettencourt

Thanks Michael (and everybody else too). I've got the thing constructed, and so far its working just as I wanted. I've still got a couple of issues with figuring out how to close all 48 windows and flowcut all with the press of one button, but I'll start a new thread for that.

Thanks again!