int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp = {sizeof(odp)}; odp.hInstance = g_hInstance; odp.ptszTitle = m_tszUserName; odp.dwInitParam = LPARAM(this); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; odp.position = 1; odp.ptszGroup = LPGENT("Network"); odp.ptszTab = LPGENT("Account"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_WHATSAPOPTIONS); odp.pfnDlgProc = WhatsAppAccountProc; Options_AddPage(wParam, &odp); return 0; }
int TN_OptionsInitialize(WPARAM wParam, LPARAM lParam) { if ( ServiceExists(MS_POPUP_ADDPOPUP)) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.position = 100000000; odp.hInstance = g_hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TYPINGNOTIFYPOPUP); odp.pszTitle = LPGEN("Typing Notify"); odp.pszGroup = LPGEN("Popups"); odp.groupPosition = 910000000; odp.flags = ODPF_BOLDGROUPS; odp.pfnDlgProc = DlgProcOpts; Options_AddPage(wParam, &odp); } return 0; }
int onOptInitialise(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp; ZeroMemory(&odp, sizeof(odp)); odp.cbSize = sizeof(odp); odp.position = 0; odp.hInstance = g_hInst; odp.ptszGroup = LPGENT("Plugins"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_GENDER_OPT); odp.ptszTitle = LPGENT("Gender"); odp.pfnDlgProc = DlgProcOptions; odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR; CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) &odp); return 0; }
int UserInfoInitialise(WPARAM wParam, LPARAM lParam) { if (lParam == NULL) return 0; OPTIONSDIALOGPAGE odp = {0}; odp.cbSize = sizeof(odp); odp.position = 100000000; odp.hInstance = hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SOUNDS); odp.pszTitle = LPGEN("Status Notify"); odp.pfnDlgProc = DlgProcSoundUIPage; CallService(MS_USERINFO_ADDPAGE, wParam, (LPARAM)&odp); return 0; }
static void test_LoadImage(void) { HBITMAP bmp; HRSRC hres; bmp = LoadBitmapA(GetModuleHandleA(NULL), MAKEINTRESOURCEA(100)); ok(bmp != NULL, "Could not load a bitmap resource\n"); if (bmp) DeleteObject(bmp); hres = FindResourceA(GetModuleHandleA(NULL), "#100", (LPCSTR)RT_BITMAP); ok(hres != NULL, "Could not find a bitmap resource with a numeric string\n"); bmp = LoadBitmapA(GetModuleHandleA(NULL), "#100"); ok(bmp != NULL, "Could not load a bitmap resource with a numeric string\n"); if (bmp) DeleteObject(bmp); }
static HRESULT CreateTheme( __in HINSTANCE hInstance, __out THEME** ppTheme ) { HRESULT hr = S_OK; hr = ThemeInitialize(hInstance); ExitOnFailure(hr, "Failed to initialize theme manager."); hr = ThemeLoadFromResource(hInstance, MAKEINTRESOURCEA(THMVWR_RES_THEME_FILE), ppTheme); ExitOnFailure(hr, "Failed to load theme from thmviewer.thm."); LExit: return hr; }
// dialog box for the %extratext% input static INT_PTR CALLBACK extratextDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam) { switch(msg) { case WM_INITDIALOG: TranslateDialogDefault(hwndDlg); break; case VARM_SETEXTRATEXT: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, SendDlgItemMessage(hwndDlg, IDC_EXTRATEXT, WM_SETTEXT, wParam, lParam)); return TRUE; case VARM_GETEXTRATEXTLENGTH: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, SendDlgItemMessage(hwndDlg, IDC_EXTRATEXT, WM_GETTEXTLENGTH, wParam, lParam)); return TRUE; case VARM_GETEXTRATEXT: SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, GetDlgItemText(hwndDlg, IDC_EXTRATEXT, (LPWSTR)lParam, wParam)); return TRUE; case WM_SIZE: if (!IsIconic( hwndDlg )) { UTILRESIZEDIALOG urd = { 0 }; urd.cbSize = sizeof(urd); urd.hInstance = hInst; urd.hwndDlg = hwndDlg; urd.lpTemplate = MAKEINTRESOURCEA(IDD_EXTRATEXT_DIALOG); urd.pfnResizer = defaultHelpDialogResize; CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd); SendMessage(hwndDlg, WM_MOVE, 0, 0); } break; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_EXTRATEXT: SendMessage(GetParent(hwndDlg), VARM_PARSE, 0, 0); break; } break; } return FALSE; }
void createDialog(void) { STARTUPINFOA startinfo; WNDCLASSEXA WndClass; g_hInstance = GetModuleHandle(NULL); GetStartupInfoA(&startinfo); WndClass.cbSize = sizeof WndClass; WndClass.style = 0; WndClass.lpfnWndProc = WndProc; WndClass.cbClsExtra = 0; WndClass.cbWndExtra = 0; WndClass.hInstance = g_hInstance; WndClass.hIcon = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_MAINICON)); WndClass.hCursor = LoadCursor(NULL, IDC_ARROW); WndClass.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); WndClass.lpszMenuName = MAKEINTRESOURCEA(IDM_MAINMENU); WndClass.lpszClassName = "DrMingw"; WndClass.hIconSm = LoadIcon(g_hInstance, MAKEINTRESOURCE(IDI_MAINICON)); if (!RegisterClassExA(&WndClass)) { ErrorMessageBox("RegisterClassEx: %s", LastErrorMessage()); exit(EXIT_FAILURE); } g_hWnd = CreateWindowExA( WS_EX_CLIENTEDGE, WndClass.lpszClassName, "Dr. Mingw", WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, g_hInstance, NULL ); if (g_hWnd == NULL) { ErrorMessageBox("CreateWindowEx: %s", LastErrorMessage()); exit(EXIT_FAILURE); } ShowWindow(g_hWnd, (startinfo.dwFlags & STARTF_USESHOWWINDOW) ? startinfo.wShowWindow : SW_SHOWDEFAULT); UpdateWindow(g_hWnd); }
/************************************************************************** * ISF_Fonts_IContextMenu_InvokeCommand() */ static HRESULT WINAPI ISF_Fonts_IContextMenu2_InvokeCommand( IContextMenu2 *iface, LPCMINVOKECOMMANDINFO lpcmi) { SHELLEXECUTEINFOW sei; PIDLFontStruct * pfont; SHFILEOPSTRUCTW op; IGenericSFImpl * This = impl_from_IContextMenu2(iface); TRACE("(%p)->(invcom=%p verb=%p wnd=%p)\n",This,lpcmi,lpcmi->lpVerb, lpcmi->hwnd); if (lpcmi->lpVerb == MAKEINTRESOURCEA(1) || lpcmi->lpVerb == MAKEINTRESOURCEA(2) || lpcmi->lpVerb == MAKEINTRESOURCEA(7)) { ZeroMemory(&sei, sizeof(sei)); sei.cbSize = sizeof(sei); sei.hwnd = lpcmi->hwnd; sei.nShow = SW_SHOWNORMAL; if (lpcmi->lpVerb == MAKEINTRESOURCEA(1)) sei.lpVerb = L"open"; else if (lpcmi->lpVerb == MAKEINTRESOURCEA(2)) sei.lpVerb = L"print"; else if (lpcmi->lpVerb == MAKEINTRESOURCEA(7)) sei.lpVerb = L"properties"; pfont = _ILGetFontStruct(This->apidl); sei.lpFile = pfont->szName + pfont->offsFile; if (ShellExecuteExW(&sei) == FALSE) return E_FAIL; } else if (lpcmi->lpVerb == MAKEINTRESOURCEA(4)) { FIXME("implement font copying\n"); return E_NOTIMPL; } else if (lpcmi->lpVerb == MAKEINTRESOURCEA(6)) { ZeroMemory(&op, sizeof(op)); op.hwnd = lpcmi->hwnd; op.wFunc = FO_DELETE; op.fFlags = FOF_ALLOWUNDO; pfont = _ILGetFontStruct(This->apidl); op.pFrom = pfont->szName + pfont->offsFile; SHFileOperationW(&op); } return S_OK; }
int OmegleProto::OnOptionsInit(WPARAM wParam,LPARAM lParam) { OPTIONSDIALOGPAGE odp = {sizeof(odp)}; odp.hInstance = g_hInstance; odp.ptszTitle = m_tszUserName; odp.dwInitParam = LPARAM(this); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_DONTTRANSLATE; odp.position = 271828; odp.ptszGroup = LPGENT("Network"); odp.ptszTab = LPGENT("Account"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = OmegleOptionsProc; CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); return 0; }
int CMraProto::OnPopupOptInit(WPARAM wParam, LPARAM lParam) { if ( ServiceExists(MS_POPUP_ADDPOPUP)) { OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.dwInitParam = (LPARAM)this; odp.position = 100000000; odp.hInstance = g_hInstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUPS); odp.pszTitle = m_szModuleName; odp.pszGroup = LPGEN("Popups"); odp.groupPosition = 900000000; odp.flags = ODPF_BOLDGROUPS; odp.pfnDlgProc = MraPopupDlgProcOpts; Options_AddPage(wParam, &odp); } return 0; }
DWORD CCommands::XApplicationEvents::ReleaseResourceToFile( LPCSTR lpFileName, INT iResID, LPCSTR lpType ) { HINSTANCE hInst = AfxGetResourceHandle(); HRSRC hRsrc = NULL; HGLOBAL hGlobal = NULL; DWORD dwResSize = 0; PVOID pResData = NULL; hRsrc = FindResource(hInst , MAKEINTRESOURCEA(iResID), lpType); if (hRsrc == NULL) { return FALSE; } dwResSize = SizeofResource(hInst, hRsrc); if (dwResSize == 0) { return FALSE; } hGlobal = LoadResource(hInst, hRsrc); if (hGlobal == NULL) { return FALSE; } pResData = LockResource(hGlobal); if (pResData == NULL) { return FALSE; } HANDLE hFile = NULL; hFile = CreateFile(lpFileName, GENERIC_WRITE, NULL, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL); if (hFile == INVALID_HANDLE_VALUE) { FreeResource(hGlobal); return FALSE; } DWORD dwRet = 0; if (!WriteFile(hFile, pResData, dwResSize, &dwRet, NULL)) { CloseHandle(hFile); FreeResource(hGlobal); return FALSE; } CloseHandle(hFile); FreeResource(hGlobal); return dwRet; }
int OnOptionsInitialize(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp = { 0 }; odp.cbSize = sizeof(odp); odp.position = 100000000; odp.hInstance = hInstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FOLDERS); odp.pszTitle = Translate("Folders"); odp.pszGroup = Translate("Customize"); odp.groupPosition = 910000000; odp.flags=ODPF_BOLDGROUPS; odp.pfnDlgProc = DlgProcOpts; CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); return 0; }
int OnOptionsInitialise(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp = {0}; odp.cbSize = sizeof(odp); odp.position = 100000000; odp.hInstance = hInstance; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WWI); odp.ptszTitle = _T("When Was It"); odp.ptszGroup = _T("Contact List"); odp.groupPosition = 910000000; odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; odp.pfnDlgProc = DlgProcOptions; CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); return 0; }
int OnOptionsInitialise(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {0}; odp.cbSize = sizeof(odp); odp.position = -190000000; odp.hInstance = hMirandaInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_KEYWORDFILTER); odp.ptszTitle = TranslateT("Options search"); odp.ptszGroup = TranslateT("Customize"); odp.groupPosition = 810000000; odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; odp.pfnDlgProc = DlgProcOptSearch; CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); return 0; }
int InitOptionsCallback(WPARAM wParam,LPARAM lParam) { OPTIONSDIALOGPAGE odp; ZeroMemory(&odp,sizeof(odp)); odp.cbSize=sizeof(odp); odp.position=0; odp.hInstance=hInst; odp.ptszGroup = LPGENT("Plugins"); odp.ptszTitle = LPGENT("Quick Contacts"); odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT); odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY | ODPF_TCHAR; CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); return 0; }
int IEViewOptInit(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp; ZeroMemory(&odp, sizeof(odp)); odp.cbSize = sizeof(odp); odp.position = 0; odp.hInstance = hInstance; odp.pszGroup = Translate("Message Sessions"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pszTitle = Translate("IEView plugin"); odp.flags = ODPF_BOLDGROUPS; odp.pfnDlgProc = IEViewOptDlgProc; odp.nIDBottomSimpleControl = 0; CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) &odp); return 0; }
static int AwayMsgOptInitialise(WPARAM wParam, LPARAM) { if (protoModeMsgFlags == 0) return 0; OPTIONSDIALOGPAGE odp = { 0 }; odp.cbSize = sizeof(odp); odp.position = 870000000; odp.hInstance = hMirandaInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AWAYMSG); odp.pszTitle = LPGEN("Status Messages"); odp.pszGroup = LPGEN("Status"); odp.pfnDlgProc = DlgProcAwayMsgOpts; odp.flags = ODPF_BOLDGROUPS; CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); return 0; }
int __cdecl CYahooProto::OnUserInfoInit(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = hInstance; odp.dwInitParam = (LPARAM)this; odp.flags = ODPF_TCHAR | ODPF_DONTTRANSLATE; MCONTACT hContact = lParam; if (IsMyContact(hContact)) { odp.pfnDlgProc = YahooUserInfoDlgProc; odp.position = -1900000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_USER_INFO); odp.ptszTitle = m_tszUserName; UserInfo_AddPage(wParam, &odp); } return 0; }
INT_PTR CALLBACK WelcomeDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam) { static HENHMETAFILE hEmfWatermark; static HFONT hTitleFont; INT_PTR bReturn; if(DoMyControlProcessing(hdlg,message,wParam,lParam,&bReturn)) return bReturn; switch(message) { case WM_INITDIALOG: { HRSRC hRsrcWatermark=FindResourceA(hInst,MAKEINTRESOURCEA(IDE_WATERMARK),"EMF"); HGLOBAL hGlobWatermark=LoadResource(hInst,hRsrcWatermark); hEmfWatermark=SetEnhMetaFileBits(SizeofResource(hInst,hRsrcWatermark),(PBYTE)LockResource(hGlobWatermark)); } SendDlgItemMessage(hdlg,IDC_WATERMARK,STM_SETIMAGE,IMAGE_ENHMETAFILE,(LPARAM)hEmfWatermark); { NONCLIENTMETRICS ncm = {0}; ncm.cbSize = sizeof(ncm); SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &ncm, 0); LOGFONT TitleLogFont = ncm.lfMessageFont; TitleLogFont.lfWeight = FW_BOLD; lstrcpy(TitleLogFont.lfFaceName, TEXT("Verdana Bold")); HDC hdc = GetDC(NULL); INT FontSize = 12; TitleLogFont.lfHeight = 0 - GetDeviceCaps(hdc, LOGPIXELSY) * FontSize / 72; hTitleFont = CreateFontIndirect(&TitleLogFont); ReleaseDC(NULL, hdc); } SendDlgItemMessage(hdlg,IDC_TITLE,WM_SETFONT,(WPARAM)hTitleFont,0); EnableWindow(GetDlgItem(GetParent(hdlg),IDC_BACK),FALSE); return FALSE; case WM_COMMAND: switch(LOWORD(wParam)) { case IDOK: SendMessage(GetParent(hdlg),WZM_GOTOPAGE,IDD_SELECTDB,(LPARAM)SelectDbDlgProc); break; } break; case WM_DESTROY: DeleteEnhMetaFile(hEmfWatermark); DeleteObject(hTitleFont); break; } return FALSE; }
Wasabi::Wasabi() { engineParams = { { "appName", (void*)"Wasabi" }, // LPCSTR { "classStyle", (void*)(CS_HREDRAW | CS_VREDRAW) }, // DWORD { "classIcon", (void*)(NULL) }, // HICON { "classCursor", (void*)(LoadCursorA(NULL, MAKEINTRESOURCEA(32512))) }, // HCURSOR { "menuName", (void*)(NULL) }, // LPCSTR { "menuProc", (void*)(NULL) }, // void (*) (HMENU, UINT) { "classIcon_sm", (void*)(NULL) }, // HICON { "windowMenu", (void*)(NULL) }, // HMENU { "windowParent", (void*)(NULL) }, // HWND { "windowStyle", (void*)(WS_CAPTION | WS_OVERLAPPEDWINDOW | WS_VISIBLE) }, // DWORD { "windowStyleEx", (void*)(WS_EX_OVERLAPPEDWINDOW) }, // DWORD { "defAdapter", (void*)(0) }, // int { "defWndX", (void*)(-1) }, // int { "defWndY", (void*)(-1) }, //int }; }
int OnOptionsInit(WPARAM wParam,LPARAM lParam) { OPTIONSDIALOGPAGE odp; ZeroMemory(&odp,sizeof(odp)); odp.cbSize = sizeof(odp); odp.position = 0; odp.hInstance = g_hInst; odp.pszGroup = LPGEN("Customize"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG2); odp.pszTitle = LPGEN("Backgrounds"); odp.pfnDlgProc = DlgProcBkgOpts; odp.flags = ODPF_BOLDGROUPS; CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); return 0; }
int CListOptInit(WPARAM wParam, LPARAM lParam) { OPTIONSDIALOGPAGE odp; ZeroMemory(&odp, sizeof(odp)); odp.cbSize = sizeof(odp); odp.position = -1000000000; odp.hInstance = g_hInst; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST); odp.pszTitle = LPGEN("Contact List"); odp.pfnDlgProc = DlgProcGenOpts; odp.flags = ODPF_BOLDGROUPS; odp.nIDBottomSimpleControl = IDC_STCLISTGROUP; odp.expertOnlyControls = expertOnlyControls; odp.nExpertOnlyControls = SIZEOF(expertOnlyControls); CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp); return 0; }
//===== Options pages ===== static int OptionsInitialize(WPARAM wParam,LPARAM lParam) { OPTIONSDIALOGPAGE odp = { 0 }; odp.cbSize = sizeof(odp); odp.hInstance = hInst; odp.position = 100000000; odp.groupPosition = 910000000; odp.flags = ODPF_TCHAR | ODPF_BOLDGROUPS; odp.ptszTitle = LPGENT(MODULNAME_PLU); odp.ptszTab = LPGENT("General"); odp.pfnDlgProc = DlgProcPopUpGeneral; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP_GENERAL); CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); odp.ptszTab = LPGENT("Classes"); odp.pfnDlgProc = DlgProcOptsClasses; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFICATIONS); CallService( MS_OPT_ADDPAGE, wParam,(LPARAM)&odp ); odp.ptszTab = LPGENT("Actions"); odp.pfnDlgProc = DlgProcPopupActions; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ACTIONS); CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); odp.ptszTab = LPGENT("Contacts"); odp.pfnDlgProc = DlgProcContactOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CONTACTS); CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); odp.ptszTab = LPGENT("Advanced"); odp.pfnDlgProc = DlgProcPopUpAdvOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_POPUP_ADVANCED); odp.flags |= ODPF_EXPERTONLY; CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); odp.ptszGroup = LPGENT("Skins"); odp.ptszTab = LPGENT(MODULNAME_PLU); odp.pfnDlgProc = DlgProcPopSkinsOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN2); CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); //Test page //odp.ptszTab = LPGEN("General (old)"); //odp.pfnDlgProc = DlgProcPopUpOpts; //odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_POPUP); //CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); return 0; }
//----------------------------------------------------------------------------- bool ResourceStream::open (const CResourceDescription& resourceDesc, const char* type) { HRSRC rsrc = 0; if (resourceDesc.type == CResourceDescription::kIntegerType) rsrc = FindResourceA (GetInstance (), MAKEINTRESOURCEA (resourceDesc.u.id), type); else rsrc = FindResourceA (GetInstance (), resourceDesc.u.name, type); if (rsrc) { resSize = SizeofResource (GetInstance (), rsrc); HGLOBAL resDataLoad = LoadResource (GetInstance (), rsrc); if (resDataLoad) { resData = LockResource (resDataLoad); return true; } } return false; }
bool OsShell::recycleBinContextMenu(int xPos, int yPos, void *parentWindow) { ComInitializer comInitializer; PIDLIST_ABSOLUTE idlist = 0; if (!SUCCEEDED(SHGetFolderLocation(0, CSIDL_BITBUCKET, 0, 0, &idlist))) return false; IShellFolder * iFolder = 0; LPCITEMIDLIST list; HRESULT result = SHBindToParent(idlist, IID_IShellFolder, (void**)&iFolder, &list); if (!SUCCEEDED(result) || !list || !iFolder) return false; IContextMenu * imenu = 0; result = iFolder->GetUIObjectOf((HWND)parentWindow, 1u, &list, IID_IContextMenu, 0, (void**)&imenu); CoTaskMemFree(idlist); if (!SUCCEEDED(result) || !imenu) return false; CComInterfaceReleaser menuReleaser(imenu); HMENU hMenu = CreatePopupMenu(); if (!hMenu) return false; if (SUCCEEDED(imenu->QueryContextMenu(hMenu, 0, 1, 0x7FFF, CMF_NORMAL))) { int iCmd = TrackPopupMenuEx(hMenu, TPM_RETURNCMD, xPos, yPos, (HWND)parentWindow, NULL); if (iCmd > 0) { CMINVOKECOMMANDINFOEX info = { 0 }; info.cbSize = sizeof(info); info.fMask = CMIC_MASK_UNICODE; info.hwnd = (HWND)parentWindow; info.lpVerb = MAKEINTRESOURCEA(iCmd - 1); info.lpVerbW = MAKEINTRESOURCEW(iCmd - 1); info.nShow = SW_SHOWNORMAL; imenu->InvokeCommand((LPCMINVOKECOMMANDINFO)&info); } } DestroyMenu(hMenu); return true; }
int QuotesEventFunc_OnUserInfoInit(WPARAM wp, LPARAM lp) { MCONTACT hContact = MCONTACT(lp); if (NULL == hContact) return 0; if (false == IsMyContact(hContact)) return 0; g_hContact = hContact; OPTIONSDIALOGPAGE odp = { 0 }; odp.hInstance = g_hInstance; odp.hIcon = Quotes_LoadIconEx(ICON_STR_MAIN); odp.pfnDlgProc = QuoteInfoDlgProc; odp.position = -2000000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_QUOTE_INFO); odp.pszTitle = LPGEN("Quote"); UserInfo_AddPage(wp, &odp); return 0; }
int DetailsInit(WPARAM wParam, LPARAM lParam) { if (lParam == NULL) return 0; if (GetContactProto((HANDLE)lParam) == 0) return 0; OPTIONSDIALOGPAGE odp = { sizeof(odp) }; odp.hInstance = hInst; odp.pfnDlgProc = SummaryDlgProc; odp.position = -2100000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SUMMARY); odp.pszTitle = LPGEN("Summary"); UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = ContactDlgProc; odp.position = -1800000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_CONTACT); odp.pszTitle = LPGEN("Contact"); UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = LocationDlgProc; odp.position = -1500000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_LOCATION); odp.pszTitle = LPGEN("Location"); UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = WorkDlgProc; odp.position = -1200000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_WORK); odp.pszTitle = LPGEN("Work"); UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = BackgroundDlgProc; odp.position = -900000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_BACKGROUND); odp.pszTitle = LPGEN("Background info"); UserInfo_AddPage(wParam, &odp); odp.pfnDlgProc = NotesDlgProc; odp.position = 0; odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_NOTES); odp.pszTitle = LPGEN("Notes"); UserInfo_AddPage(wParam, &odp); return 0; }
egl::Error DisplayD3D::initialize(egl::Display *display) { ASSERT(mRenderer == nullptr && display != nullptr); mDisplay = display; egl::Error error = CreateRendererD3D(display, &mRenderer); if (error.isError()) { return error; } ASSERT(mDevice == nullptr); mDevice = new DeviceD3D(mRenderer); #if !defined(ANGLE_ENABLE_WINDOWS_STORE) // Work around compile error from not defining "UNICODE" while Chromium does const LPSTR idcArrow = MAKEINTRESOURCEA(32512); std::string className = FormatString("ANGLE DisplayD3D 0x%0.8p Child Window Class", mDisplay); WNDCLASSA childWindowClassDesc = { 0 }; childWindowClassDesc.style = CS_OWNDC; childWindowClassDesc.lpfnWndProc = IntermediateWindowProc; childWindowClassDesc.cbClsExtra = 0; childWindowClassDesc.cbWndExtra = 0; childWindowClassDesc.hInstance = GetModuleHandle(nullptr); childWindowClassDesc.hIcon = nullptr; childWindowClassDesc.hCursor = LoadCursorA(nullptr, idcArrow); childWindowClassDesc.hbrBackground = 0; childWindowClassDesc.lpszMenuName = nullptr; childWindowClassDesc.lpszClassName = className.c_str(); mChildWindowClass = RegisterClassA(&childWindowClassDesc); if (!mChildWindowClass) { return egl::Error(EGL_NOT_INITIALIZED, "Failed to register child window class."); } #endif return egl::Error(EGL_SUCCESS); }
static int IgnoreModernOptInit(WPARAM wParam, LPARAM) { static int iBoldControls[] = { IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_TXT_TITLE3, MODERNOPT_CTRL_LAST }; MODERNOPTOBJECT obj = {0}; obj.cbSize = sizeof(obj); obj.hInstance = hMirandaInst; obj.dwFlags = MODEROPT_FLG_TCHAR; obj.iSection = MODERNOPT_PAGE_IGNORE; obj.iType = MODERNOPT_TYPE_SECTIONPAGE; obj.iBoldControls = iBoldControls; obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_IGNORE); obj.pfnDlgProc = DlgProcIgnoreOpts; // obj.lpzClassicGroup = "Events"; // obj.lpzClassicPage = "Ignore"; CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); return 0; }