Solved

porting dll's

Posted on 2002-06-12
4
159 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
ID: 7072726
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]
ID: 7072732
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
ID: 7072893
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
ID: 7074628
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

937 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

7 Experts available now in Live!

Get 1:1 Help Now