- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'm in the process of taking old code that was written in some flavor of Fortran (Microsoft?) by another developer and converting it to the new version of Compaq Visual Fortran. Everything seems to be converting just fine with the exception of a call to mousel. From what I can find, mousel is a call to a function in Microsoft's Mouse Library. Unfortunately, I don't have this library or any documentation on understanding the syntax of the call.
Does anyone know what can be used in Compaq Visual Fortran that is compatible to the mousel call in Microsoft Fortran?
Message Edited by marshallc on 10-26-2004 07:04 AM
Link Copied
8 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Your post suggests that your old code is/was 16-bit. Things are very different under Windows, and it is likely that none of the user-interface content of your old program can be retained.
Under Windows, you never call the mouse -- the mouse calls you, by sending specific mouse activity messages (ie, "left button clicked once") to your Proc function which is associated with your active window, whereupon you can perform whatever code actions are called for in response to the mouse event.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I had a feeling this was from 16-bit code. The only problem with getting it converted to the current method is that I need to understand the old method. The developer that previously worked with this is no longer with the company, and they wiped the computer that housed the old compiler... including all the help files. Now, I'm trying to find out what the parameters are for the MOUSEL function in order to convert the code to the current methods of doing it. I would like to redo the code, but time isn't on my side so I'm trying to get the current code to work in the time that is available.
Do you have any info on the MOUSEL function?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ouch. I naively started googling thinking I would find some clear reference, but that turned far out more difficult. Here's what I've found:
1) MSDN states that MOUSEL is "long" type of call for what used to be CALL MOUSE. (http://support.microsoft.com/default.aspx?scid=kb;en-us;43735;) there's also a brief but cryptical piece of code in (http://support.microsoft.com/default.aspx?scid=kb;en-us;51225).
2) Google search for "Microsoft mouse programmer's reference" turned out to be more productive than "Mousel".
3) One of links there leads here, which further leads to this page, which looks like the most promising one.
Well... good luck. If you finally find out what the original code is doing, you can come back here to find out Win32 equivalents.
Jugoslav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, you already know what the mouse-processing part of your new 32-bit program needs to look like (see Petzold or similar for numerous examples of Proc functions and mouse-message handling).
Deconstructing your old code should not require detailed knowledge of what the old mouse library did, only the general activity context such as process a click or abstract the current mouse coordinates. Thus you can isolate the code block which deals with processing a click, and move it into the appropriate CASE (WM_etc.) location forconditional execution.
IIRC, in DOS any mouse activity would generate an interrupt, and load some registers with its activity status and current screen position. All that MOUSEL did was to access those registers and return the values, which you could do equally well with a general INT22 register access routine. Windows now does all of this automatically, and sorts out which window gets the message and exactly what type of action was involved.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In this case, the previous developer was trying to change the actual mouse cursor. I've been looking for information on how this is done. In particular, how to animate the cursor since the current code appears to be changing the cursor to a clock and animating that clock. I found similar code in Microsoft's knowledgebase, but it doesn't provide more detail about what a mask is or how it is laid out. This and the controlling of the mouse using the mousel command has me stumped. The code on Microsoft's site is at: http://support.microsoft.com/default.aspx?scid=kb;en-us;51225
How do I go about doing this in Compaq Fortran? I admit I'm a newbie to Fortran and unclear on how mouse calls are done. If you have any suggestions on places, books, whatever that could help me get "educated" on customizing the mouse especially in regards to taking the Microsoft Fortran code shown on the site and converting it to Compaq Fortran, I would greatly appreciate it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The attached file contains a F90 example of a Proc function which processes mouse messages, and which changes the displayed cursor depending on various internal contexts. This has been extracted from a much larger code and is not directly runnable, but should illustrate the basic structural elements for incorporating the mouse into your own code.
HTH,
Paul Curtis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the sample! You're right. The way a mouse is called or referenced is different from the way it was done in the 16-bit code. I recently got a copy of the Compaq Visual Fortran Guide to Creating Windows Apps, and it is really limited on the discussion about the mouse. It mentions a couple of commands, and that's it. It doesn't show any examples like the one you provided. Do you know of a good source to find more information on making references to the mouse?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Well, you can find all of it in CVF's Win32 Help (Platform SDK), or in MSDN. On the other hand, it's so huge that it's difficult to find relevant information.
For this particular problem, the information is divided into two chapters: User Interface ServicesResourcesCursors and User Interface ServicesUser InputMouse input. Note, however, that the principal difference is that (regarding mouse input), Windows tells you that the mouse was moved/clicked/etc rather than you should ask. (If you're porting to QuickWin, you can set up mouse callbacks to achieve the same thing as handling WM_MOUSEMOVE or WM_LBUTTON*).
Regarding cursors, there are two basic methods. Both require you to draw a cursor in the resource editor, save it as resource, load it using LoadCursor[FromFile] API (there is no QuickWin interface to it). You can save cursor handle (hNewCursor) as a global variable or a local SAVEd variable. Then:
1) (Simple) use hOldCursor = SetClassLong(GetHWNDQQ(whatever), GCL_HCURSOR, hNewCursor). This sets up the cursor for entire client area of the window.
2) (More powerful) Handle WM_SETCURSOR as Paul demonstrated in his sample and return the cursor handle. If you're in QuickWin, you have to subclass the window to achieve that -- POKER CVF sample or my sample QWToolbar demonstrate the technique. Handling WM_SETCURSOR allows you to e.g. change the cursor depending on its location within the window.
HTH
Jugoslav
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page