Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Use of Enumwindows
Message
From
06/06/2002 04:20:27
 
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00665274
Message ID:
00665301
Views:
19
Hi!

VFP is not capable to work with functions that require callback functions. Callback function is a function which address you pass into the API call and then API DLL calls your function when needed. It is possible to do in VB (there is an AddressOf() function there). In VFP all functions are just internal compiled P-code for interpreter, not a pure processor codes, so it is not possible to provide a physical address of function for call-back call. Well, I guess it is possible to "wrap" function into some sort of assembler codes that starts work for interpreting a function, but this already added to wishes list for next versions of VFP.

Just in your case you can workaround the EnumWiondows API function by using a few other functions. There is a GetWindow() function that allow you to browse windows in any direction you want. So, get the current Window HWND (GetActiveWindow() function), then move forward till returned value is 0, then move backward till returned value is 0.

Put all returned HWND values into array and do not do any processing of windows in the loop. This is because you have to finish the loop as quick as possible for reliable result - while you're scanning all windows, some other window might open at the moment. Then use result in array to process windows you want.

Let me know if you want a few code samples or have questions.

>Hi all.
>
>I've been looking for an example on how to use the enumwindows function. I've found many vb examples, but nothing on the proper use in vfp.
>
>tia
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform