MCPcopy Create free account
hub / github.com/mhammond/pywin32 / ui_thread_set_main_frame

Function ui_thread_set_main_frame

Pythonwin/win32thread.cpp:235–254  ·  view source on GitHub ↗

@pymethod |PyCWinThread|SetMainFrame|Sets the threads main frame

Source from the content-addressed store, hash-verified

233
234// @pymethod |PyCWinThread|SetMainFrame|Sets the threads main frame
235static PyObject *
236ui_thread_set_main_frame(PyObject *self, PyObject *args)
237{
238 PyObject *wndObject;
239 if (!PyArg_ParseTuple(args, "O:SetMainFrame",
240 &wndObject )) // @pyparm <o PyCWnd>|mainFrame||The applications main frame.
241 return NULL;
242 CWinThread *pThread = GetCWinThreadPtr(self);
243 if (!pThread) return NULL;
244
245 if (wndObject==Py_None) {
246 // @comm You can pass None to this function to reset the main frame.
247 pThread->m_pMainWnd = NULL; // Should I free this? I dont think so!
248 } else {
249 CWnd *pMainWnd = GetWndPtr(wndObject);
250 if (!pMainWnd) return NULL;
251 pThread->m_pMainWnd = pMainWnd;
252 }
253 RETURN_NONE;
254}
255
256// @pymethod |PyCWinThread|SetThreadPriority|Sets the threads priority. Returns TRUE if successful.
257static PyObject *

Callers

nothing calls this directly

Calls 2

GetCWinThreadPtrFunction · 0.85
GetWndPtrFunction · 0.85

Tested by

no test coverage detected