?
Solved

porting dll's

Posted on 2002-06-12
4
Medium Priority
?
163 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 46

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 143

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 46

Accepted Solution

by:
aikimark earned 300 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…
Suggested Courses

762 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