Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Command Button - New To API Calls in Fox Pro
Message
From
29/09/1997 14:53:47
Frank Shaw
Runestones Development Corporation
Ipswich, Massachusetts, United States
 
 
To
29/09/1997 12:15:11
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00052189
Message ID:
00052232
Views:
53
>>I have not used API calls in foxpro I did have some experince using them in Visual basic a while back and I remember that when I can not get something to work the way I wanted it to I could always call a API function that would do the trick. I have read that call back functions are not supported in foxpro Is that true. I want to trap the user pressing the command button when he press the button will a API call help or does some have any other ideas. In am using Windows 95 and I want to trap the command button being pressed before lostfocus event of another control. Or better yet how to tell what control has been pressed in the activate or gotfocus event of a form with a container. If the answer is a API call how do I setup the call and then call the function. What place in the code should I set up the declare or and example of code. Do I need a call back function and how can I do it in foxpro. Is their a 3rd party that has built call back functions in foxpro. My other option I guess
>>would be to do something about the event handler in foxpro can I modify it to know where and what control has been pressed last. Pardon my fishing but I am looking for some type of solution to my problem.
>>
>>
>>Frank H. Shaw
>>fshaw@runestones.com
>
>Frank, you are going too far. The problem doesn't require API calls. Use following:
>*** your control LostFocus event
>thisform.command1.click()
>if thisform.flag1=.t.
> =messagebox("really clicked")
>endif
>*** command1 click event
>thisform.flag1=.t.
>**** more code


So what you are saying in the lostfocus event of the active control call the command buttons click methord in the click methord set a flag and return upon checking the status of the flag then in the lostfocus event of the control to see if it is set. That would work if their is a way to tell I come from the lostfocus event or from clicking the button directly. I guess I could do that with a flag also.

But is their a way to tell what control was last used. Or trap the window message I do remember that in visual basic I was able to setup a control called a window hook and then I could monitor the window messages before the application gets them. Does FoxPro support this type of API function. How about a third party solution. I remember the button sent a WM_COMMAND message to its parent and places a Button Id value in the wParam value of the message. The lParam would contain the button controls window handle in the low order word and the notification code like BN_CLICKED in the high order word. Can this be done in foxpro use a API to monitor the window message before the application or foxpro gets them. And how does this different in windows 95 machine using visual foxpro 5.0a. Then I would know for shure what button was clicked.


>>Frank H. Shaw
>>fshaw@runestones.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform