这篇教程C++ EXDLL_INIT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中EXDLL_INIT函数的典型用法代码示例。如果您正苦于以下问题:C++ EXDLL_INIT函数的具体用法?C++ EXDLL_INIT怎么用?C++ EXDLL_INIT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了EXDLL_INIT函数的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: __declspecvoid __declspec(dllexport) SetTransparent(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra){ WINUSERAPIBOOL WINAPI SetLayeredWindowAttributes(HWND hwnd, COLORREF crKey, BYTE bAlpha, DWORD dwFlags); HWND hwnd; BYTE bAlpha; LONG lwnd; EXDLL_INIT();// MessageBox(hwndParent,"EXDLL_INIT",NULL,MB_OK); extra->RegisterPluginCallback(g_hInstance, PluginCallback); hwnd = (HWND) (popint()); bAlpha = popint() * 255 / 100; if (IsWindow(hwnd)) { lwnd = GetWindowLong(hwnd, GWL_EXSTYLE);/* if (lwnd < WS_EX_LAYERED) { lwnd = lwnd + WS_EX_LAYERED; SetWindowLong(hwnd, GWL_EXSTYLE, lwnd); }*/ SetWindowLong(hwnd, GWL_EXSTYLE, lwnd | WS_EX_LAYERED); SetLayeredWindowAttributes(hwnd, 0, bAlpha, LWA_ALPHA); }}
开发者ID:fengshao5411,项目名称:nswindows_domodal,代码行数:27,
示例2: __declspecextern "C" void __declspec(dllexport) IsUserAdmin( HWND hwndParent, int string_size, char *variables, stack_t **stacktop){ EXDLL_INIT(); BOOL b = false; SID_IDENTIFIER_AUTHORITY NtAuthority = SECURITY_NT_AUTHORITY; PSID AdministratorsGroup; b = AllocateAndInitializeSid( &NtAuthority, 2, SECURITY_BUILTIN_DOMAIN_RID, DOMAIN_ALIAS_RID_ADMINS, 0, 0, 0, 0, 0, 0, &AdministratorsGroup); if(b) { if (!CheckTokenMembership( NULL, AdministratorsGroup, &b)) { setuservariable( INST_0, "0" ); } else { setuservariable( INST_0, "1" ); } FreeSid(AdministratorsGroup); }}
开发者ID:gene9,项目名称:Darwinia-and-Multiwinia-Source-Code,代码行数:29,
示例3: __declspecextern "C" void __declspec(dllexport) open_file_dialog( HWND hwndParent, int string_size, char *variables, stack_t **stacktop){ EXDLL_INIT(); char szBuffer[1024]=""; popstring(szBuffer); HWND hWndParent = (HWND)atoi(szBuffer); CFileDialog dlg(TRUE, _T("lic"), NULL, OFN_FILEMUSTEXIST, _T("CrashFix License Files (*.lic)/0*.lic/0All Files (*.*)/0*.*/0/0"), hWndParent); INT_PTR nResult = dlg.DoModal(hWndParent); if(nResult==IDOK) { CStringA sFileName = dlg.m_szFileName; pushstring(sFileName.GetBuffer()); } else { pushstring(""); } }
开发者ID:WarfaceKievTechOps,项目名称:crashfix,代码行数:25,
示例4: __declspecvoid __declspec(dllexport) UpdateDriver(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra){ int retval; g_hwndParent=hwndParent; EXDLL_INIT(); { BOOL restart = 0; DWORD flags = 0;//INSTALLFLAG_NONINTERACTIVE DWORD lastErrorCode; char hardwareID[256]; char infFilePath[256]; popstring(hardwareID); popstring(infFilePath); retval = eIDUpdateDriver(hwndParent,hardwareID,infFilePath,flags,&restart, &lastErrorCode); if(retval != 0) { //on succes, let the caller know if a system reboot was requested pushint((int)restart); } else { //on failure, send the error code pushint((int)lastErrorCode); } pushint(retval); }}
开发者ID:Andhr3y,项目名称:dcfd-mw-applet,代码行数:33,
示例5: VBoxTrayShowBallonMsg/** * Shows a balloon message using VBoxTray's notification area in the * Windows task bar. * * @param hwndParent Window handle of parent. * @param string_size Size of variable string. * @param variables The actual variable string. * @param stacktop Pointer to a pointer to the current stack. */VBOXINSTALLHELPER_EXPORT VBoxTrayShowBallonMsg(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop){ EXDLL_INIT(); VBOXTRAYIPCHEADER hdr; hdr.ulMsg = VBOXTRAYIPCMSGTYPE_SHOWBALLOONMSG; hdr.cbBody = sizeof(VBOXTRAYIPCMSG_SHOWBALLOONMSG); VBOXTRAYIPCMSG_SHOWBALLOONMSG msg; HRESULT hr = vboxPopString(msg.szContent, sizeof(msg.szContent) / sizeof(TCHAR)); if (SUCCEEDED(hr)) hr = vboxPopString(msg.szTitle, sizeof(msg.szTitle) / sizeof(TCHAR)); if (SUCCEEDED(hr)) hr = vboxPopULong(&msg.ulType); if (SUCCEEDED(hr)) hr = vboxPopULong(&msg.ulShowMS); if (SUCCEEDED(hr)) { msg.ulFlags = 0; HANDLE hPipe = vboxIPCConnect(); if (hPipe) { hr = vboxIPCWriteMessage(hPipe, (BYTE*)&hdr, sizeof(VBOXTRAYIPCHEADER)); if (SUCCEEDED(hr)) hr = vboxIPCWriteMessage(hPipe, (BYTE*)&msg, sizeof(VBOXTRAYIPCMSG_SHOWBALLOONMSG)); vboxIPCDisconnect(hPipe); } } /* Push simple return value on stack. */ SUCCEEDED(hr) ? pushstring("0") : pushstring("1");}
开发者ID:mutoso-mirrors,项目名称:vbox,代码行数:44,
示例6: __declspecvoid __declspec(dllexport) ExecToStack(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { g_hwndParent=hwndParent; EXDLL_INIT(); { ExecScript(2); }}
开发者ID:kichik,项目名称:nsis-1,代码行数:7,
示例7: __declspecvoid __declspec(dllexport) GetFileCRC32(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop) { g_hwndParent=hwndParent; EXDLL_INIT(); { TCHAR filename[MAX_PATH]; char crc_string[9]; HANDLE hFile; unsigned long crc; popstring(filename); hFile = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if (hFile == INVALID_HANDLE_VALUE) { //pushstring("ERROR: Unable to open file for CRC32 calculation"); pushstring(_T("")); return; } if (!FileCRC(hFile, &crc)) { //pushstring("ERROR: Unable to calculate CRC32"); pushstring(_T("")); } else { crc_string[8] = '/0'; CRC32ToString(crc_string,crc); PushStringA(crc_string); } CloseHandle(hFile); }}
开发者ID:151706061,项目名称:nsis-chinese,代码行数:34,
示例8: __declspecvoid __declspec(dllexport) IsDotNet30Installed(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra) { EXDLL_INIT(); // The .NET Framework 3.0 is an add-in that installs // on top of the .NET Framework 2.0. For this version // check, validate that both 2.0 and 3.0 are installed. pushstring((IsNetfx20Installed() && IsNetfx30Installed() && CheckNetfxVersionUsingMscoree(g_szNetfx20VersionString)) ? "true" : "false");}
开发者ID:grmartin,项目名称:NsisDotNetChecker,代码行数:8,
示例9: __declspecvoid __declspec(dllexport) LangDialog(HWND hwndParent, int string_size, char *variables, stack_t **stacktop){ g_hwndParent=hwndParent; EXDLL_INIT(); { int i; BOOL bPopOneMore = FALSE; if (popstring(g_wndtitle)) return; if (popstring(g_wndtext)) return; if (popstring(temp)) return; if (*temp == 'A') { stack_t *th; langs_num=0; th=(*g_stacktop); while (th && th->text[0]) { langs_num++; th = th->next; } if (!th) return; langs_num /= 2; bPopOneMore = TRUE; } else langs_num = myatoi(temp); { char *p=temp; while (*p) if (*p++ == 'F') dofont=1; } if (!langs_num) return; langs = (struct lang *)GlobalAlloc(GPTR, langs_num*sizeof(struct lang)); for (i = 0; i < langs_num; i++) { if (popstring(temp)) return; langs[i].name = GlobalAlloc(GPTR, lstrlen(temp)+1); lstrcpy(langs[i].name, temp); if (popstring(temp)) return; langs[i].id = GlobalAlloc(GPTR, lstrlen(temp)+1); lstrcpy(langs[i].id, temp); } if (bPopOneMore) { if (popstring(temp)) return; } DialogBox(g_hInstance, MAKEINTRESOURCE(IDD_DIALOG), 0, DialogProc); }}
开发者ID:kichik,项目名称:nsis-1,代码行数:54,
示例10: __declspecextern "C" void __declspec(dllexport) show(HWND hwndParent, int string_size, char *variables, stack_t **stacktop){ EXDLL_INIT(); if (!initCalled) { pushstring("error"); return; } initCalled--; showCfgDlg();}
开发者ID:kichik,项目名称:nsis-1,代码行数:11,
示例11: __declspecvoid __declspec(dllexport) CalculateSha512Sum(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters *extra){ int i; TCHAR filename[1024]; Sha512Context context; HANDLE file; char buffer[512]; char comp[1024]; DWORD bytesread; SHA512_HASH sha512; int compout; EXDLL_INIT(); popstring(filename); popstring(comp); Sha512Initialise(&context); file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL); if (!file) { filename[0] = '0'; filename[1] = 0; pushstring(comp); pushstring(filename); return; } while (1) { ReadFile(file, buffer, 512, &bytesread, NULL); if (!bytesread) break; Sha512Update(&context, buffer, bytesread); if (bytesread < 512) break; } Sha512Finalise(&context, &sha512); CloseHandle(file); for (i = 0; i < (512 / 8); i++) { buffer[i * 2] = hexdigit(sha512.bytes[i] >> 4); buffer[(i * 2) + 1] = hexdigit(sha512.bytes[i] & 0xF); } buffer[512 / 4] = 0; compout = memcmp(buffer, comp, 128); if (compout) { filename[0] = '0'; } else { filename[0] = '1'; } filename[1] = 0; pushstring(comp); pushstring(filename);}
开发者ID:if15b006,项目名称:dxgl,代码行数:54,
示例12: FileGetVendor/** * Retrieves a file's vendor. * Outputs the vendor's name or an error message (if not found/invalid) on stack. * * @param hwndParent Window handle of parent. * @param string_size Size of variable string. * @param variables The actual variable string. * @param stacktop Pointer to a pointer to the current stack. */VBOXINSTALLHELPER_EXPORT FileGetVendor(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop){ NOREF(hwndParent); EXDLL_INIT(); TCHAR szFile[MAX_PATH + 1]; HRESULT hr = vboxPopString(szFile, sizeof(szFile) / sizeof(TCHAR)); if (SUCCEEDED(hr)) { DWORD dwInfoSize = GetFileVersionInfoSize(szFile, NULL /* lpdwHandle */); if (dwInfoSize) { void *pFileInfo = GlobalAlloc(GMEM_FIXED, dwInfoSize); if (pFileInfo) { if (GetFileVersionInfo(szFile, 0, dwInfoSize, pFileInfo)) { LPVOID pvInfo; UINT puInfoLen; if (VerQueryValue(pFileInfo, _T("//VarFileInfo//Translation"), &pvInfo, &puInfoLen)) { WORD wCodePage = LOWORD(*(DWORD*)pvInfo); WORD wLanguageID = HIWORD(*(DWORD*)pvInfo); TCHAR szQuery[MAX_PATH];#pragma warning(suppress:4995) /* warning C4995: '_sntprintf': name was marked as #pragma deprecated */ _sntprintf(szQuery, sizeof(szQuery), _T("StringFileInfo//%04X%04X//CompanyName"), wCodePage,wLanguageID); LPCTSTR pcData; if (VerQueryValue(pFileInfo, szQuery,(void**)&pcData, &puInfoLen)) { pushstring(pcData); } else hr = __HRESULT_FROM_WIN32(ERROR_NOT_FOUND); } else hr = __HRESULT_FROM_WIN32(ERROR_NOT_FOUND); } GlobalFree(pFileInfo); } else hr = __HRESULT_FROM_WIN32(ERROR_OUTOFMEMORY); } else hr = __HRESULT_FROM_WIN32(ERROR_NOT_FOUND); } if (FAILED(hr)) vboxPushResultAsString(hr);}
开发者ID:svn2github,项目名称:virtualbox,代码行数:62,
示例13: __declspecvoid __declspec(dllexport) GetName(HWND hwndParent, int string_size, char *variables, stack_t **stacktop){ EXDLL_INIT(); { DWORD dwStringSize = g_stringsize; stack_t *th; if (!g_stacktop) return; th = (stack_t*) GlobalAlloc(GPTR, sizeof(stack_t) + g_stringsize); GetUserName(th->text, &dwStringSize); th->next = *g_stacktop; *g_stacktop = th; }}
开发者ID:kichik,项目名称:nsis-1,代码行数:15,
示例14: __declspecvoid __declspec(dllexport) Create(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra){ HWND hwPlacementRect; RECT rcPlacement; EXDLL_INIT(); extra->RegisterPluginCallback(g_hInstance, PluginCallback); g_dialog.hwParent = hwndParent; g_pluginParms = extra; hwPlacementRect = GetDlgItem(hwndParent, popint()); GetWindowRect(hwPlacementRect, &rcPlacement); MapWindowPoints(NULL, hwndParent, (LPPOINT) &rcPlacement, 2); g_dialog.hwDialog = CreateDialog(g_hInstance, MAKEINTRESOURCE(1), hwndParent, DialogProc); if (g_dialog.hwDialog == NULL) { pushstring("error"); return; } SetWindowPos( g_dialog.hwDialog, 0, rcPlacement.left, rcPlacement.top, rcPlacement.right - rcPlacement.left, rcPlacement.bottom - rcPlacement.top, SWP_NOZORDER | SWP_NOACTIVATE ); g_dialog.parentOriginalWndproc = (WNDPROC) SetWindowLong(hwndParent, DWL_DLGPROC, (long) ParentProc); g_dialog.rtl = FALSE; g_dialog.controlCount = 0; g_dialog.controls = (struct nsControl*) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, 0); g_dialog.callbacks.onBack = 0; pushint((int) g_dialog.hwDialog);}
开发者ID:Mobivity,项目名称:nsis-logset-on-debian,代码行数:45,
示例15: DisableWFP/** * Disables the Windows File Protection for a specified file * using an undocumented SFC API call. Don't try this at home! * * @param hwndParent Window handle of parent. * @param string_size Size of variable string. * @param variables The actual variable string. * @param stacktop Pointer to a pointer to the current stack. */VBOXINSTALLHELPER_EXPORT DisableWFP(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop){ EXDLL_INIT(); TCHAR szFile[MAX_PATH + 1]; HRESULT hr = vboxPopString(szFile, sizeof(szFile) / sizeof(TCHAR)); if (SUCCEEDED(hr)) { HMODULE hSFC = loadSystemDll("sfc_os.dll"); /** @todo Replace this by RTLdr APIs. */ if (NULL != hSFC) { g_pfnSfcFileException = (PFNSFCFILEEXCEPTION)GetProcAddress(hSFC, "SfcFileException"); if (g_pfnSfcFileException == NULL) { /* If we didn't get the proc address with the call above, try it harder with * the (zero based) index of the function list. */ g_pfnSfcFileException = (PFNSFCFILEEXCEPTION)GetProcAddress(hSFC, (LPCSTR)5); if (g_pfnSfcFileException == NULL) hr = HRESULT_FROM_WIN32(ERROR_PROC_NOT_FOUND); } } else hr = HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND); if (SUCCEEDED(hr)) { WCHAR *pwszFile; hr = vboxChar2WCharAlloc(szFile, &pwszFile); if (SUCCEEDED(hr)) { if (g_pfnSfcFileException(0, pwszFile, -1) != 0) hr = HRESULT_FROM_WIN32(GetLastError()); vboxChar2WCharFree(pwszFile); } } if (hSFC) FreeLibrary(hSFC); } vboxPushResultAsString(hr);}
开发者ID:jeppeter,项目名称:vbox,代码行数:52,
示例16: __declspecvoid __declspec(dllexport) show(HWND hwndParent, int string_size, TCHAR *variables, stack_t **stacktop, extra_parameters *extra){ EXDLL_INIT(); extra->RegisterPluginCallback(hInstance, PluginCallback); { DWORD dwThreadId; DWORD dwMainThreadId = GetCurrentThreadId(); hwBanner = NULL; if (!IsWindowVisible(hwndParent)) hwndParent = 0; bFailed = FALSE; hThread = CreateThread(0, 0, BannerThread, (LPVOID) hwndParent, 0, &dwThreadId); // wait for the window to initalize and for the stack operations to finish while (hThread && !hwBanner && !bFailed) { ProcessMessages(); Sleep(10); } CloseHandle(hThread); if (AttachThreadInput(dwMainThreadId, dwThreadId, TRUE)) { // Activates and displays a window ShowWindow(hwBanner, SW_SHOW); AttachThreadInput(dwMainThreadId, dwThreadId, FALSE); } else ShowWindow(hwBanner, SW_SHOW); }}
开发者ID:kichik,项目名称:nsis-1,代码行数:38,
示例17: __declspecvoid __declspec(dllexport) myFunction(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters *extra){ g_hwndParent=hwndParent; EXDLL_INIT(); // note if you want parameters from the stack, pop them off in order. // i.e. if you are called via exdll::myFunction file.dat poop.dat // calling popstring() the first time would give you file.dat, // and the second time would give you poop.dat. // you should empty the stack of your parameters, and ONLY your // parameters. // do your stuff here { char buf[1024]; wsprintf(buf,"$0=%s/n",getuservariable(INST_0)); MessageBox(g_hwndParent,buf,0,MB_OK); }}
开发者ID:03050903,项目名称:Torque3D,代码行数:23,
示例18: __declspecextern "C" void __declspec(dllexport) SetImage(HWND hwndParent, int string_size, char *variables, stack_t **stacktop) { EXDLL_INIT(); popstring(temp); if (!lstrcmp(temp, "/FILLSCREEN")) { x = GetSystemMetrics(SM_CXSCREEN); y = GetSystemMetrics(SM_CYSCREEN); popstring(temp); } else x = y = 0; BITMAP bitmap; if (hBitmap) DeleteObject((HGDIOBJ)hBitmap); hBitmap = (HBITMAP)LoadImage(0, temp, IMAGE_BITMAP, x, y, LR_LOADFROMFILE); if (!hBitmap) { pushstring("can't load bitmap"); return; } GetObject(hBitmap, sizeof(bitmap), (LPSTR)&bitmap); x = x ? x : bitmap.bmWidth; y = y ? y : bitmap.bmHeight; if (hWndImage) { SetWindowPos( hWndImage, hWndParent, (GetSystemMetrics(SM_CXSCREEN)-x)/2, (GetSystemMetrics(SM_CYSCREEN)-y)/2, x, y, SWP_NOACTIVATE ); RedrawWindow(hWndImage, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW); }}
开发者ID:kichik,项目名称:nsis-1,代码行数:37,
注:本文中的EXDLL_INIT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ EXEC函数代码示例 C++ EXC_TRY函数代码示例 |