Core Function PTRToDLLStruct
From Sputnik Wiki
(Difference between revisions)
UberFoX (Talk | contribs)
(Created page with "<pre> PTRToDLLStruct( <def string>, <ptr> ) </pre> === Description === Reads a DLLStruct from a memory pointer === Parameters === ==== def string ==== A string representing...")
Newer edit →
(Created page with "<pre> PTRToDLLStruct( <def string>, <ptr> ) </pre> === Description === Reads a DLLStruct from a memory pointer === Parameters === ==== def string ==== A string representing...")
Newer edit →
Revision as of 11:42, 28 March 2012
PTRToDLLStruct( <def string>, <ptr> )
Contents |
Description
Reads a DLLStruct from a memory pointer
Parameters
def string
A string representing the structure to create (See DLLStructCreate).
ptr
A pointer to allocated memory to use as the Structs data.
Return Value
Success - Returns the DLLStruct.
Failure - Returns 0 and most likely throws exception.
Remarks
None.
Example
DLLStructCreateDef("WindowPos", @" ptr hwnd; ptr hwndInsertAfter; int x; int y; int cx; int cy; uint flags "); // Create the MDI GUI $GUI = GUICreate("MDIWindow", "GUI", 800, 600); // Show the MDI GUI GUILoad( $GUI ); // Create the Design Window $Window = GUICreate("Window", "GUI", 640, 482, 0, 0); GUIMDIParent($Window, $GUI); // Show the Design Window GUILoad( $Window ); // Add a MsgFilter to Design Window GUIWndProc($Window, "DesignWndProc();"); // Keep the GUI running as long as long as the window is open While ( GUIStatus( $GUI ) ) DoEvents( ); Function DesignWndProc() { if ($MSG == 0x0046) # WM_WINDOWPOSCHANGING { $Struct = PTRToDLLStruct("WindowPos", $LParam); DLLStructSetData($Struct, "x", 0); DLLStructSetData($Struct, "y", 0); } return 0; }