Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WNDCLASS structure
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00094673
Message ID:
00094693
Views:
18
>>>>Good news 2 - The WNDCLASS structure I mentioned earlier can be examined to see if a running application is a screen saver. The lpszClassName member of the structure will contain "WindowsScreenSaverClass", however, I don't see an index that will allow GetClassLong() to return that member.
>>>
>>>
>>>BTW, what are you using to get and examine the WNDCLASS struct?
>>
>>You mean the strings returned? What I do is get a memory address by allocating 4K on the heap, then I use the string copy function to move it first to the heap, then to mine own string. Works well, I picked up from a FoxPro Advisor article by Gary DeWitt.
>>
>>If you want to know details, let's start a new thread. This one's long enough ;-)
>
>Yes do tell. I have had a devil of a time with structs and VFP.
Donald,

Here you go:
* Functions for dealing with the heap
DECLARE INTEGER HeapCreate IN Win32API;
  INTEGER flOptions, INTEGER dwInitialSize,;
  INTEGER DWMaximumSize
DECLARE INTEGER HeapAlloc IN Win32API;
  INTEGER hHeap, INTEGER dwFlags, INTEGER dwBytes
DECLARE INTEGER HeapDestroy IN Win32API;
  INTEGER nHeap
DECLARE INTEGER HeapFree IN Win32API;
  INTEGER nHeap, INTEGER dwFlags, INTEGER lpMem
* Create Heap
lnHeap = HeapCreate(0, 4096, 0)
* Allocate Memory
lnMemory = HeapAlloc(lnHeap, 0, 255)
* To write a string to the lnMemory address
* lcstring is the string to write
* Compare this declaration to the one that follows
DECLARE INTEGER lstrcpy IN Win32API;
  INTEGER lpszString1, STRING @lpszString2
* lnpointer is the pointer returned
lnpointer = lstrcpy(lnMemory, @pcstring)
* Get a string's value from a pointer
* pcstring is the buffer to copy to
* and should be large enough to hold the entire
* string (including terminating NULL)
DECLARE INTEGER lstrcpy IN Win32API;
  STRING @lpszString1, INTEGER lpszString2
lnpointer = lstrcpy(@lcstring, lnpointer)
* Free up the resources
= HeapFree(lnHeap, 0, lnMemory)
= HeapDestroy(lnHeap)
As I mentioned, I picked this up from an article by Gary DeWitt in FoxPro Advisor. It was Nov. 1997, I think.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform