def desktop_name_dlgproc(hwnd, msg, wparam, lparam):
 if (msg in (win32con.WM_CLOSE, win32con.WM_DESTROY)):
  win32gui.DestroyWindow(hwnd)
 elif (msg == win32con.WM_COMMAND):
  if (wparam == win32con.IDOK):
   desktop_name = win32gui.GetDlgItemText(hwnd, 72)
   print 'new desktop name: ', desktop_name
   win32gui.DestroyWindow(hwnd)
   create_desktop(desktop_name)
  elif (wparam == win32con.IDCANCEL):
   win32gui.DestroyWindow(hwnd)

def desktop_name_dlgproc ( hwnd , msg , wparam , lparam ) : if ( msg in ( win32con . WM_CLOSE , win32con . WM_DESTROY ) ) : win32gui . DestroyWindow ( hwnd ) elif ( msg == win32con . WM_COMMAND ) : if ( wparam == win32con . IDOK ) : desktop_name = win32gui . GetDlgItemText ( hwnd , 72 ) print 'new desktop name: ' , desktop_name win32gui . DestroyWindow ( hwnd ) create_desktop ( desktop_name ) elif ( wparam == win32con . IDCANCEL ) : win32gui . DestroyWindow ( hwnd )
handles messages from the desktop name dialog box .