示例#1
0
BOOL DateTimeWnd_Init(HWINDOW hWindow,int x,int y,int cx,int cy,HWND hWndParent,int exType)
{
	BOOL res= Wnd_Init(hWindow,NULL,NULL,NULL,WS_POPUP,x,y,cx,cy,hWndParent,0,exType);
	if(res)
	{
		AddTypeDebug(hWindow,XC_DATETIMEWINDOW);

		XWnd_RegisterMessage(hWindow,WM_PAINT,DateTimeWnd_OnDrawWindow);
		XWnd_RegisterMessage(hWindow,WM_KILLFOCUS,DateTimeWnd_OnKillFocus);
		XWnd_RegisterNCMessage(hWindow,XWM_NCLBUTTONDOWN,DateTimeWnd_OnNCLButtonDown);

		((dateTimeWindow_*)hWindow)->hMonthCal=XMonthCal_Create(1,1,MONTHCAL_WIDTH,MONTHCAL_HEIGHT,hWindow);
		
		XEle_RegisterEvent(((dateTimeWindow_*)hWindow)->hMonthCal,XE_MONTHCAL_CHANGE,DateTimeWnd_OnEventMonthSelect);
		SetCapture(XWnd_GetHWnd(hWindow));
	}
	return res;
}
示例#2
0
文件: main.cpp 项目: majek/avs
static int init(struct winampVisModule *this_mod)
{
	DWORD id;
  FILETIME ft;
#if 0//syntax highlighting
  if (!hRich) hRich=LoadLibrary("RICHED32.dll");
#endif
  GetSystemTimeAsFileTime(&ft);
  srand(ft.dwLowDateTime|ft.dwHighDateTime^GetCurrentThreadId());
	g_hInstance=this_mod->hDllInstance;
	GetModuleFileName(g_hInstance,g_path,MAX_PATH);
	char *p=g_path+strlen(g_path);
	while (p > g_path && *p != '\\') p--;
	*p = 0;

#ifdef WA2_EMBED
  if (SendMessage(this_mod->hwndParent,WM_USER,0,0) < 0x2900)
  {
    MessageBox(this_mod->hwndParent,"This version of AVS requires Winamp 2.9+","AVS ERROR",MB_OK|MB_ICONSTOP);
    return 1;
  }
#endif

#ifndef NO_MMX
  extern int is_mmx(void);
  if (!is_mmx())
  {
    MessageBox(this_mod->hwndParent,"NO MMX SUPPORT FOUND - CANNOT RUN AVS - GET THE NON-MMX VERSION.","AVS ERROR",MB_OK|MB_ICONSTOP);
    return 1;
  }
#endif

#ifdef LASER
  strcat(g_path,"\\avs_laser");
#else
  strcat(g_path,"\\avs");
#endif
  CreateDirectory(g_path,NULL);

	InitializeCriticalSection(&g_cs);
	InitializeCriticalSection(&g_render_cs);
	g_ThreadQuit=0;
	g_visdata_pstat=1;

  AVS_EEL_IF_init();

	if (Wnd_Init(this_mod)) return 1;

	{
		int x;
		for (x = 0; x < 256; x ++)
		{
			double a=log(x*60.0/255.0 + 1.0)/log(60.0);
			int t=(int)(a*255.0);
			if (t<0)t=0;
			if (t>255)t=255;
			g_logtab[x]=(unsigned char )t;
		}
	}

  initBpm();

	Render_Init(g_hInstance);

	CfgWnd_Create(this_mod);

	g_hThread=(HANDLE)_beginthreadex(NULL,0,RenderThread,0,0,(unsigned int *)&id);
  main_setRenderThreadPriority();
  SetForegroundWindow(g_hwnd);
  SetFocus(g_hwnd);

  return 0;
}