[pywin32-checkins] pywin32/win32/src win32gui.i,1.72,1.73
OLD project page for the Python extensions for Windows
Brought to you by:
mhammond
From: Mark H. <mha...@us...> - 2006-01-10 00:22:25
|
Update of /cvsroot/pywin32/pywin32/win32/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28145/win32/src Modified Files: win32gui.i Log Message: Add CreateIconFromResource and CreateIConIndirect. Index: win32gui.i =================================================================== RCS file: /cvsroot/pywin32/pywin32/win32/src/win32gui.i,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -d -r1.72 -r1.73 *** win32gui.i 2 Dec 2005 07:49:49 -0000 1.72 --- win32gui.i 10 Jan 2006 00:22:15 -0000 1.73 *************** *** 2158,2161 **** --- 2158,2186 ---- HICON CreateIconIndirect(ICONINFO *INPUT); + %{ + // @pyswig int|CreateIconFromResource|Creates an icon or cursor from resource bits describing the icon. + static PyObject *PyCreateIconFromResource(PyObject *self, PyObject *args) + { + // @pyparm string|bits||The bits + // @pyparm bool|fIcon||True if an icon, False if a cursor. + // @pyparm int|ver|0x00030000|Specifies the version number of the icon or cursor + // format for the resource bits pointed to by the presbits parameter. + // This parameter can be 0x00030000. + char *bits; + int nBits; + int isIcon; + int ver = 0x00030000; + if (!PyArg_ParseTuple(args, "s#i|i", &bits, &nBits, &isIcon, &ver)) + return NULL; + HICON ret = CreateIconFromResource((PBYTE)bits, nBits, isIcon, ver); + if (!ret) + return PyWin_SetAPIError("CreateIconFromResource"); + return PyLong_FromVoidPtr(ret); + } + %} + %native (CreateIconFromResource) PyCreateIconFromResource; + + HICON CreateIconIndirect(); + // @pyswig HANDLE|LoadImage|Loads a bitmap, cursor or icon HANDLE LoadImage(HINSTANCE hInst, // @pyparm int|hinst||Handle to an instance of the module that contains the image to be loaded. To load an OEM image, set this parameter to zero. |