Solved

porting dll's

Posted on 2002-06-12
4
156 Views
Last Modified: 2010-05-02
ive got a program that works in winxp and win2k. it used some of the dll's of these OS.
i want to port it to Win98 but it doesent have the required dll's
any ideas
0
Comment
Question by:shaikh1024
  • 2
4 Comments
 
LVL 45

Expert Comment

by:aikimark
Comment Utility
If the top-most form is visible to the user, then how would they see what/where they want to click on the overlayed form?
0
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
aikimark, please have some imagination: it could be a game where the user has to try to point it's mouse to a "hidden" place...
0
 

Expert Comment

by:angel71
Comment Utility
Can't give you a solution, only some hints which might help you:
- catch the mouseevents on the top form and raise an event
- in the even handler (could be a form or a controling class) find out what at what location the cursor is at the top most form and call the thing which is at the form underneath.
Good luck!



0
 
LVL 45

Accepted Solution

by:
aikimark earned 100 total points
Comment Utility
As far as I can tell, you are going to need the setcursor and mouse_event APIs.  If you capture the X,Y coordinates of the user click, you can position the mouse and click the mouse with code.  If you have four forms, you can tile them to appear as one until the click.  Then 'move' them aside ever so slightly so you can point-and-click the mouse on the underlying form.

I thought about solving this problem setting the overlaying form as TopMost (yet another API), but I don't think it will work.

=======================================
Some of the APIs you might need:

Private Type POINTAPI
    x As Long
    y As Long
End Type
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Const MOUSEEVENTF_ABSOLUTE = &H8000 ' absolute move
Private Const MOUSEEVENTF_LEFTDOWN = &H2 ' left button down
Private Const MOUSEEVENTF_LEFTUP = &H4 ' left button up
Private Const MOUSEEVENTF_MOVE = &H1 ' mouse move
Private Const MOUSEEVENTF_MIDDLEDOWN = &H20
Private Const MOUSEEVENTF_MIDDLEUP = &H40
Private Const MOUSEEVENTF_RIGHTDOWN = &H8
Private Const MOUSEEVENTF_RIGHTUP = &H10

Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Private Declare Function GetMessageExtraInfo Lib "user32" () As Long
Public Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Const SM_CXSCREEN = 0 'X Size of screen
Const SM_CYSCREEN = 1 'Y Size of Screen

Private Sub Click(p As POINTAPI)
'p.X and p.Y in absolute coordinates
'Put the mouse on the point

   mouse_event MOUSEEVENTF_ABSOLUTE Or MOUSEEVENTF_MOVE, p.x, p.y, 0, GetMessageExtraInfo()
   'Mouse Down
   mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, GetMessageExtraInfo()
   'Mouse Up
   mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, GetMessageExtraInfo()

End Sub
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now