If the DC is already grabbed, the value is simply returned without grabbing it again.
id is either a simple integer or a sequence {id,option}. In the latter case, option is the sum of zero or more flags:
When using the DC_OPT_WINDOW flag, be sure to have released the standard window DC prior. In these DC's, coordinates are relative to the window rectangle, and not to the client rectangle.
There are some special cases that are handled:
When you are done with the DC, it should be released with releaseDC unless the DC was obtained during an onPaint event, since the DC will be released automatically.
See Also: getIdFromDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Func, w32Proc
DC is the device context returned by getDC
This is primarily used by add-on libraries as a way to use Win32lib routines that need a control ID rather than a device context.
Example:
integer id id = getIdFromDC ( theDC )
See Also: getDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Func, w32Proc
This deactivates timer that was set with setTimer.
Example:
-- deactivate timer #12 killTimer( MyWindow, 12 )
See Also: getDC, getIdFromDC, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Func, w32Proc
The library function is not actually linked until its first usage.
Example:
xLoadIcon = registerw32Function(user32, "LoadIconA", {C_POINTER, C_POINTER}, C_POINTER)
See Also: getDC, getIdFromDC, killTimer, registerw32Library, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Func, w32Proc
ret (INTEGER) An identifier for the library, to be used in registerw32Function or registerw32Procedure. name is either a DLL name or a list of DLL names. If a list, then they are tried from left to right until one is linked.
The library is not actually opened until it's first usage.
Example
atom libRichEdit, libUser -- Use riched20 if possible else use riched32 libRichEdit = registerw32Library({"riched20.dll", "riched32.dll"} )libUser = registerw32Library("user32.dll")
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Func, w32Proc
The library procedure is not actually linked until its first usage.
Example:
constant xKillTimer = registerw32Procedure(user32, "KillTimer", {C_POINTER, C_UINT})
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Library, releaseDC, sendMessage, setTimer, w32Func, w32Proc
The DC should have been obtained with getDC.
If the control is not a Pixmap or DIB, and the DC was obtained during an onPaint event, there is no need to release the DC. Win32Lib will automatically release all DCs obtained during an onPaint event.
If the control is the Printer, there is no need to release the DC using releaseDC. Instead, use releasePrinter
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, sendMessage, setTimer, w32Func, w32Proc
id is either a control ID, or a control Name.
command is the Windows Message code to send.
wParam and lParam are the appropriate data items for the specific
command you are sending. These can be either atom values or text strings.
There are hundreds of Windows message codes. Each type of control responds to commands that are specific to it. There are too many to document here but they can be found in many publications - the easiest might be the Microsoft SDK documentation found at http://msdn.microsoft.com . Here is a list of messages understood bu win32lib, but it is not a comprehensive listing. As a matter of fact, there is not a single, authoritative, official, comprehensive listing.
Example:
res = sendMessage(myToolbar, TB_ADDSTRING, 0, "Test String" )
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, setTimer, w32Func, w32Proc
Timers are clocks that are maintained by Windows, and trigger events at a user-specified interval, measured in milliseconds.
The arguments are:
To respond to timer events, set a handler for the w32HTimer event. You can have more than one timer per window. If your window is too busy to receive the timer messages, they will be discarded.
Example:
-- start a timer with id #12 in MyWindow -- it will trigger every 3 seconds. setTimer( MyWindow, 12, 3000 )
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, sendMessage, w32Func, w32Proc
The function to invoke is supplied in funcid. This can either be an identifier returned by registerw32Function() or one returned by define_c_func().
The parameters for the function are contained in the sequence parms.
Example:
-- Get the width of the screen. screenCX = w32Func(xGetSystemMetrics, {SM_CXSCREEN})
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Proc
The procedure to invoke is supplied in procid. This can either be an identifier returned by registerw32Procedure() or one returned by define_c_proc().
The parameters for the procedure are contained in the sequence parms.
Example:
-- Force the window to be updated now. w32Func(xUpdateWindow, {getHandle(myWin)})
See Also: getDC, getIdFromDC, killTimer, registerw32Function, registerw32Library, registerw32Procedure, releaseDC, sendMessage, setTimer, w32Func