/** * Attempts to initialize X3D. */ _Bool x3d_init() { uint16 dll_status; x3d = &x3d_global_enginestate; x3d->error_msg = ""; // Step 1: init screen if(!x3d_platform_screen_init(&x3d->screen, LCD_WIDTH, LCD_HEIGHT, 1)) { x3d->error_msg = "Failed to init screen"; goto error_screen; } // Step 2: load DLL UnloadDLL(); if((dll_status = LoadDLL("x3d", X3D_ID, 1, 0)) != DLL_OK) { switch(dll_status) { case DLL_NOTFOUND: x3d->error_msg = "X3D DLL not found"; break; default: break; } goto error_dll; } x3d->error_msg = "Success!"; return X3D_FALSE; error_dll: x3d_platform_screen_cleanup(&x3d->screen); error_screen: return X3D_FALSE; }
//新的计算器过程函数 LRESULT CALLBACK WindowProc( HWND hwnd, // handle to window UINT uMsg, // message identifier WPARAM wParam, // first message parameter LPARAM lParam // second message parameter ) { #ifdef HOOK_HOME EnterCriticalSection(&g_cs); #endif //0x84 if (uMsg == WM_COMMAND) { WORD wNotifyCode = HIWORD(wParam); WORD wID = LOWORD(wParam); HWND hwndCtl = (HWND) lParam; if (hwndCtl != NULL) { if (VK_FOR_8 == wID && BN_CLICKED == wNotifyCode) { ::MessageBox(NULL, "8 Clicked", "Inject", MB_OK); } }//控件 else if (0 == wNotifyCode) { if (MYMSG_FEATURE == wID) { MessageBox(NULL, "FEATURE", NULL, MB_OK); DialogBox(g_hModule, MAKEINTRESOURCE(IDD_DIALOG1), g_hCalc, DLGPROC(DlgProc) ); } else if (MYMSG_ABOUT == wID) { MessageBox(NULL, "ABOUT", NULL, MB_OK); } }//menu } else if (WM_KEYDOWN == uMsg) { //::MessageBox(NULL, "WM_KEYUP", NULL, MB_OK); //#define VK_HOME 0x24 if (VK_HOME == wParam) { ::MessageBox(NULL, "Home", NULL, MB_OK); ProcessWalk(); } else if ('8' == wParam) { UnloadDLL(); } } #ifdef HOOK_HOME //查找hWnd所对应的消息处理函数 for (int i = 0; i < g_nCount; i++) { if (hwnd == g_hWnd[i]) { break; } } LRESULT lRet = g_OldProc[i](hwnd, uMsg, wParam, lParam); LeaveCriticalSection(&g_cs); return lRet; #else return g_pfnOld(hwnd, uMsg, wParam, lParam); #endif }
VOID Shutdown3DSDriver (VOID) { UnloadDLL(&hwsModule); }
VOID Shutdown3DDriver (VOID) { UnloadDLL(&hwdModule); }
CLibMP3DLL::~CLibMP3DLL(void) { UnloadDLL(); }