static INT OnLogOff( IN HWND hwndDlg, IN PGINA_CONTEXT pgContext) { return pgContext->pWlxFuncs->WlxDialogBoxParam( pgContext->hWlx, pgContext->hDllInstance, MAKEINTRESOURCEW(IDD_LOGOFF_DLG), hwndDlg, LogOffDialogProc, (LPARAM)pgContext); }
static INT OnShutDown( IN HWND hwndDlg, IN PGINA_CONTEXT pgContext) { return pgContext->pWlxFuncs->WlxDialogBoxParam( pgContext->hWlx, pgContext->hDllInstance, MAKEINTRESOURCEW(IDD_SHUTDOWN_DLG), hwndDlg, ShutDownDialogProc, (LPARAM)pgContext); }
static VOID GUIDisplayLockedNotice( IN OUT PGINA_CONTEXT pgContext) { TRACE("GUIdisplayLockedNotice()\n"); pgContext->pWlxFuncs->WlxDialogBoxParam( pgContext->hWlx, pgContext->hDllInstance, MAKEINTRESOURCEW(IDD_LOCKED_DLG), GetDesktopWindow(), LockedWindowProc, (LPARAM)pgContext); }
static VOID GUIDisplaySASNotice( IN OUT PGINA_CONTEXT pgContext) { TRACE("GUIDisplaySASNotice()\n"); /* Display the notice window */ pgContext->pWlxFuncs->WlxDialogBoxParam(pgContext->hWlx, pgContext->hDllInstance, MAKEINTRESOURCEW(IDD_NOTICE_DLG), GetDesktopWindow(), EmptyWindowProc, (LPARAM)pgContext); }
void XAP_Win32Dialog_WindowMore::runModal(XAP_Frame * pFrame) { UT_ASSERT(pFrame); UT_ASSERT(m_id == XAP_DIALOG_ID_WINDOWMORE); // NOTE: this work could be done in XP code m_ndxSelFrame = m_pApp->findFrame(pFrame); UT_ASSERT(m_ndxSelFrame >= 0); // raise the dialog setDialog(this); createModal(pFrame, MAKEINTRESOURCEW(XAP_RID_DIALOG_WINDOWMORE)); }
/***************************************************** * Hack ahead !!! * * Problems here have to do with focus handling, i.e. * sharing and passing keyboard focus back and forth from * the gecko window to the rest of the app. The gecko * wants us to turn focus on and off when we receive the * WM_ACTIVATE message for our window; Gtk+ does not give * us an opportunity to act on this message (TODO: patch * gtk+ to do so and run tests). * * Also tried to turn on and off focus near when activate * messages come (i.e. focus in/out of the toplevel window) * with no luck (works to get started, but the gecko * will never relinquish focus afterwords). * * The current hack/workaround: * We are using a native toplevel window, that we reposition * to follow the widget hierarchy on toplevel configure events, * this way we handle the WM_ACTIVATE messages and focus handleing * works, on the other hand accelerators keys tied into the higher * level window wont trigger when the gecko has focus (is that * already the case ?) and the apps toplevel will be painted as * an inactive window. */ static HWND create_native_window(GtkWidget *widget) { static ATOM klass = 0; HWND window_handle, parent_handle; DWORD dwStyle, dwExStyle; if (!klass) { static WNDCLASSEXW wcl; wcl.cbSize = sizeof(WNDCLASSEX); wcl.style = 0; /* DON'T set CS_<H,V>REDRAW. It causes total redraw * on WM_SIZE and WM_MOVE. Flicker, Performance! */ wcl.lpfnWndProc = (WNDPROC)window_procedure; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; wcl.hInstance = GetModuleHandle(NULL); wcl.hIcon = 0; wcl.hIconSm = 0; wcl.lpszMenuName = NULL; wcl.hIcon = NULL; wcl.hIconSm = NULL; wcl.hbrBackground = NULL; wcl.hCursor = LoadCursor(NULL, IDC_ARROW); wcl.lpszClassName = L"MozWindow"; klass = RegisterClassExW(&wcl); } dwExStyle = WS_EX_TOOLWINDOW; // for popup windows dwStyle = WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS; // popup window parent_handle = (HWND)GDK_WINDOW_HWND(gtk_widget_get_parent_window(widget)); window_handle = CreateWindowExW(dwExStyle, MAKEINTRESOURCEW(klass), L"", dwStyle, 0, 0, 1, 1, parent_handle, NULL, GetModuleHandle(NULL), NULL); SetProp(window_handle, "moz-view-widget", (HANDLE)widget); return window_handle; }
/************************************************************************** * ISvItemCm_fnQueryContextMenu() */ static HRESULT WINAPI ISvItemCm_fnQueryContextMenu( IContextMenu2 *iface, HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { ItemCmImpl *This = impl_from_IContextMenu2(iface); INT uIDMax; TRACE("(%p)->(hmenu=%p indexmenu=%x cmdfirst=%x cmdlast=%x flags=%x )\n",This, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags); This->verb_offset=idCmdFirst; if(!(CMF_DEFAULTONLY & uFlags) && This->cidl>0) { HMENU hmenures = LoadMenuW(shell32_hInstance, MAKEINTRESOURCEW(MENU_SHV_FILE)); if(uFlags & CMF_EXPLORE) RemoveMenu(hmenures, FCIDM_SHVIEW_OPEN, MF_BYCOMMAND); uIDMax = Shell_MergeMenus(hmenu, GetSubMenu(hmenures, 0), indexMenu, idCmdFirst, idCmdLast, MM_SUBMENUSHAVEIDS); DestroyMenu(hmenures); if(This->bAllValues) { MENUITEMINFOW mi; WCHAR str[255]; mi.cbSize = sizeof(mi); mi.fMask = MIIM_ID | MIIM_STRING | MIIM_FTYPE; mi.dwTypeData = str; mi.cch = 255; GetMenuItemInfoW(hmenu, FCIDM_SHVIEW_EXPLORE, MF_BYCOMMAND, &mi); RemoveMenu(hmenu, FCIDM_SHVIEW_EXPLORE, MF_BYCOMMAND); _InsertMenuItemW(hmenu, (uFlags & CMF_EXPLORE) ? 1 : 2, MF_BYPOSITION, FCIDM_SHVIEW_EXPLORE, MFT_STRING, str, MFS_ENABLED); } SetMenuDefaultItem(hmenu, 0, MF_BYPOSITION); if(uFlags & ~CMF_CANRENAME) RemoveMenu(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND); else EnableMenuItem(hmenu, FCIDM_SHVIEW_RENAME, MF_BYCOMMAND | ISvItemCm_CanRenameItems(This) ? MFS_ENABLED : MFS_DISABLED); return MAKE_HRESULT(SEVERITY_SUCCESS, 0, uIDMax-idCmdFirst); } return MAKE_HRESULT(SEVERITY_SUCCESS, 0, 0); }
BOOL DIALOG_FileSaveAs(VOID) { OPENFILENAMEW saveas; WCHAR szPath[MAX_PATH]; WCHAR szDir[MAX_PATH]; static const WCHAR szDefaultExt[] = { 't','x','t',0 }; static const WCHAR txt_files[] = { '*','.','t','x','t',0 }; ZeroMemory(&saveas, sizeof(saveas)); GetCurrentDirectoryW(ARRAY_SIZE(szDir), szDir); lstrcpyW(szPath, txt_files); saveas.lStructSize = sizeof(OPENFILENAMEW); saveas.hwndOwner = Globals.hMainWnd; saveas.hInstance = Globals.hInstance; saveas.lpstrFilter = Globals.szFilter; saveas.lpstrFile = szPath; saveas.nMaxFile = ARRAY_SIZE(szPath); saveas.lpstrInitialDir = szDir; saveas.Flags = OFN_ENABLETEMPLATE | OFN_ENABLEHOOK | OFN_EXPLORER | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT | OFN_HIDEREADONLY | OFN_ENABLESIZING; saveas.lpfnHook = OfnHookProc; saveas.lpTemplateName = MAKEINTRESOURCEW(IDD_OFN_TEMPLATE); saveas.lpstrDefExt = szDefaultExt; /* Preset encoding to what file was opened/saved last with. */ Globals.encOfnCombo = Globals.encFile; Globals.bOfnIsOpenDialog = FALSE; retry: if (!GetSaveFileNameW(&saveas)) return FALSE; switch (DoSaveFile(szPath, Globals.encOfnCombo)) { case SAVED_OK: SetFileNameAndEncoding(szPath, Globals.encOfnCombo); UpdateWindowCaption(); return TRUE; case SHOW_SAVEAS_DIALOG: goto retry; default: return FALSE; } }
BOOL CToolTipCtrl::AddTool(HWND hWnd,UINT nIDText,LPCRECT lpRectTool,UINT nIDTool,LPARAM lParam) { if (IsUnicodeSystem()) { TOOLINFOW ti; ti.cbSize=TTTOOLINFOW_V2_SIZE; ti.uFlags=TTF_SUBCLASS; ti.hwnd=hWnd; ti.uId=nIDTool; ti.hinst=GetLanguageSpecificResourceHandle(); ti.lpszText=MAKEINTRESOURCEW(nIDText); ti.lParam=lParam; if (lpRectTool!=NULL) ti.rect=*lpRectTool; else if (hWnd!=NULL) ::GetClientRect(hWnd,&ti.rect); else { ti.rect.left=0; ti.rect.right=0; ti.rect.top=0; ti.rect.bottom=0; } return (BOOL)::SendMessageW(m_hWnd,TTM_ADDTOOLW,0,(LPARAM)&ti); } else { TOOLINFO ti; ti.cbSize=TTTOOLINFOA_V2_SIZE; ti.uFlags=TTF_SUBCLASS; ti.hwnd=hWnd; ti.uId=nIDTool; ti.hinst=GetLanguageSpecificResourceHandle(); ti.lpszText=MAKEINTRESOURCE(nIDText); ti.lParam=lParam; if (lpRectTool!=NULL) ti.rect=*lpRectTool; else if (hWnd!=NULL) ::GetClientRect(hWnd,&ti.rect); else { ti.rect.left=0; ti.rect.right=0; ti.rect.top=0; ti.rect.bottom=0; } return (BOOL)::SendMessage(m_hWnd,TTM_ADDTOOL,0,(LPARAM)&ti); } }
static INT_PTR CALLBACK DownloadDlgProc(HWND Dlg, UINT Msg, WPARAM wParam, LPARAM lParam) { HANDLE Thread; DWORD ThreadId; HWND Item; switch (Msg) { case WM_INITDIALOG: hIcon = LoadIconW(hInst, MAKEINTRESOURCEW(IDI_MAIN)); if (hIcon) { SendMessageW(Dlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon); SendMessageW(Dlg, WM_SETICON, ICON_SMALL, (LPARAM) hIcon); } SetWindowLongPtrW(Dlg, GWLP_USERDATA, 0); Item = GetDlgItem(Dlg, IDC_DOWNLOAD_PROGRESS); if (Item) { SendMessageW(Item, PBM_SETRANGE, 0, MAKELPARAM(0, 100)); SendMessageW(Item, PBM_SETPOS, 0, 0); } Thread = CreateThread(NULL, 0, ThreadFunc, Dlg, 0, &ThreadId); if (!Thread) return FALSE; CloseHandle(Thread); return TRUE; case WM_COMMAND: if (wParam == IDCANCEL) { SetWindowLongPtrW(Dlg, GWLP_USERDATA, 1); PostMessageW(Dlg, WM_CLOSE, 0, 0); } return FALSE; case WM_CLOSE: if (hIcon) DestroyIcon(hIcon); EndDialog(Dlg, 0); return TRUE; default: return FALSE; } }
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { FPS = 1/60; interval = 1000*FPS; HWND hwnd; MSG msg = {0}; WNDCLASSEX wc = {0}; wc.cbSize = sizeof(WNDCLASSEX); wc.lpfnWndProc = WndProc; wc.hInstance = GetModuleHandle(NULL); wc.hbrBackground = (HBRUSH)(COLOR_BACKGROUND); wc.lpszClassName = "Hello,world"; wc.style = CS_OWNDC; wc.cbClsExtra = 0; wc.cbWndExtra = 0; wc.hCursor = LoadCursor(NULL,IDC_ARROW); wc.hIcon = LoadIconW(NULL,MAKEINTRESOURCEW(IDI_APPLICATION)); wc.hIconSm = LoadIconW(NULL,MAKEINTRESOURCEW(IDI_APPLICATION)); if(!RegisterClassEx(&wc)) return 1; hwnd = CreateWindowW(L"Hello,World",L"Hello,World",WS_OVERLAPPEDWINDOW|WS_VISIBLE,0,0,640,480,0,0,hInstance,0); ShowWindow(hwnd, nCmdShow); //display the window on the screen UpdateWindow(hwnd); while(GetMessage(&msg,NULL,0,0) > 0) { DispatchMessage(&msg); time_t elapse = time(NULL) - appTime; if(elapse >= interval) { appTime += elapse; } } return 0; }
void slot1Dialog(HWND hwnd) { strcpy(tmp_fat_path, slot1_GetFatDir().c_str()); strcpy(tmp_fs_path, path.getpath(path.SLOT1D).c_str()); temp_type_slot1 = slot1_GetCurrentType(); last_type_slot1 = temp_type_slot1; _OKbutton_slot1 = false; needReset_slot1 = true; u32 res=DialogBoxW(hAppInst, MAKEINTRESOURCEW(IDD_SLOT1CONFIG), hwnd, (DLGPROC)Slot1Box_Proc); if (res) { switch (temp_type_slot1) { case NDS_SLOT1_NONE: if (temp_type_slot1 != slot1_GetCurrentType()) needReset_slot1 = true; else needReset_slot1 = false; break; case NDS_SLOT1_RETAIL_AUTO: case NDS_SLOT1_RETAIL_MCROM: break; case NDS_SLOT1_R4: if (strlen(tmp_fat_path)) { slot1_SetFatDir(tmp_fat_path); WritePrivateProfileString("Slot1","FAT_path",tmp_fat_path,IniName); } break; case NDS_SLOT1_RETAIL_NAND: break; case NDS_SLOT1_RETAIL_DEBUG: if (strlen(tmp_fs_path)) { path.setpath(path.SLOT1D, tmp_fs_path); WritePrivateProfileString(SECTION, SLOT1DKEY, path.pathToSlot1D, IniName); } break; default: return; } WritePrivateProfileInt("Slot1","type",temp_type_slot1,IniName); slot1_Change((NDS_SLOT1_TYPE)temp_type_slot1); return; } }
static HRESULT WINAPI RecycleBinMenu_QueryContextMenu(IContextMenu2 *iface, HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) { HMENU menures = LoadMenuW(shell32_hInstance,MAKEINTRESOURCEW(MENU_RECYCLEBIN)); if(uFlags & CMF_DEFAULTONLY) return E_NOTIMPL; else{ UINT idMax = Shell_MergeMenus(hmenu,GetSubMenu(menures,0),indexMenu,idCmdFirst,idCmdLast,MM_SUBMENUSHAVEIDS); TRACE("Added %d id(s)\n",idMax-idCmdFirst); return MAKE_HRESULT(SEVERITY_SUCCESS, FACILITY_NULL, idMax-idCmdFirst+1); } }
void AP_Win32Dialog_FormatFrame::runModeless(XAP_Frame * pFrame) { UT_return_if_fail (pFrame); UT_return_if_fail (m_id == AP_DIALOG_ID_FORMAT_FRAME); createModeless(pFrame, MAKEINTRESOURCEW(AP_RID_DIALOG_FORMATFRAME)); // Save dialog the ID number and pointer to the widget UT_sint32 sid =(UT_sint32) getDialogId(); m_pApp->rememberModelessId( sid, (XAP_Dialog_Modeless *) m_pDialog); ShowWindow(m_hDlg, SW_SHOW); BringWindowToTop(m_hDlg); }
int __stdcall FsExecuteFileW(HWND MainWin, WCHAR* RemoteName, WCHAR* Verb) { INT_PTR dlgResult = 0; if(wcscmp(Verb, L"open") == 0 && wcscmp(RemoteName, L"\\[²Ù×÷]ÐÂÔöÍøÅÌ") == 0) { if(!available_disk_entries_length) { RequestProcW(PluginNumber, RT_MsgOK, L"ÅäÖôíÎó", L"ÍøÅ̽ű¾´íÎó, ûÓÐÉèÖÃÈκÎÓÐЧµÄÍøÅÌÅäÖÃÎļþ. ", NULL, 0); return FS_EXEC_ERROR; } dlgResult = DialogBoxW((HINSTANCE)hInst, MAKEINTRESOURCEW(IDD_NEW), GetActiveWindow(), NewdiskProc); if(dlgResult == IDOK) { wcslcpy(RemoteName, L"\\", PATH_MAX); return FS_EXEC_SYMLINK; } return FS_EXEC_OK; } return FS_EXEC_ERROR; }
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam) { // NOTE: This callback is needed to set large icon correctly. HICON hIcon; switch (uMsg) { case PSCB_INITIALIZED: { hIcon = LoadIconW(hApplet, MAKEINTRESOURCEW(IDI_USRMGR_ICON)); SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon); break; } } return 0; }
static BOOL dlg_configure_lpt(HANDLE hXcv, HWND hWnd) { lptconfig_t data; BOOL res; data.hXcv = hXcv; res = DialogBoxParamW(LOCALUI_hInstance, MAKEINTRESOURCEW(LPTCONFIG_DIALOG), hWnd, dlgproc_lptconfig, (LPARAM) &data); TRACE("got %u with %u\n", res, GetLastError()); if (!res) SetLastError(ERROR_CANCELLED); return res; }
static HWND show_wait_window(void) { const char *config_dir = wine_get_config_dir(); WCHAR *name; HWND hwnd; DWORD len; len = MultiByteToWideChar( CP_UNIXCP, 0, config_dir, -1, NULL, 0 ); name = HeapAlloc( GetProcessHeap(), 0, len * sizeof(WCHAR) ); MultiByteToWideChar( CP_UNIXCP, 0, config_dir, -1, name, len ); hwnd = CreateDialogParamW( GetModuleHandleW(0), MAKEINTRESOURCEW(IDD_WAITDLG), 0, wait_dlgproc, (LPARAM)name ); ShowWindow( hwnd, SW_SHOWNORMAL ); HeapFree( GetProcessHeap(), 0, name ); return hwnd; }
static void DisplayPopupMenu(HHInfo *info) { HMENU menu, submenu; TBBUTTONINFOW button; MENUITEMINFOW item; POINT coords; RECT rect; DWORD index; menu = LoadMenuW(hhctrl_hinstance, MAKEINTRESOURCEW(MENU_POPUP)); if (!menu) return; submenu = GetSubMenu(menu, 0); /* Update the Show/Hide menu item */ item.cbSize = sizeof(MENUITEMINFOW); item.fMask = MIIM_FTYPE | MIIM_STATE | MIIM_STRING; item.fType = MFT_STRING; item.fState = MF_ENABLED; if (info->WinType.fNotExpanded) item.dwTypeData = HH_LoadString(IDS_SHOWTABS); else item.dwTypeData = HH_LoadString(IDS_HIDETABS); SetMenuItemInfoW(submenu, IDTB_EXPAND, FALSE, &item); heap_free(item.dwTypeData); /* Find the index toolbar button */ button.cbSize = sizeof(TBBUTTONINFOW); button.dwMask = TBIF_COMMAND; index = SendMessageW(info->WinType.hwndToolBar, TB_GETBUTTONINFOW, IDTB_OPTIONS, (LPARAM) &button); if (index == -1) return; /* Get position */ SendMessageW(info->WinType.hwndToolBar, TB_GETITEMRECT, index, (LPARAM) &rect); coords.x = rect.left; coords.y = rect.bottom; ClientToScreen(info->WinType.hwndToolBar, &coords); TrackPopupMenu(submenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_LEFTBUTTON | TPM_NOANIMATION, coords.x, coords.y, 0, info->WinType.hwndHelp, NULL); }
static void ApplicationPageShowContextMenu2(void) { HMENU hMenu; HMENU hSubMenu; UINT count; POINT pt; GetCursorPos(&pt); hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATION_PAGE_CONTEXT2)); hSubMenu = GetSubMenu(hMenu, 0); count = SendMessageW(hApplicationPageListCtrl, LVM_GETSELECTEDCOUNT, 0, 0); if (count == 1) { EnableMenuItem(hSubMenu, ID_WINDOWS_TILEHORIZONTALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_TILEVERTICALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_MINIMIZE, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_MAXIMIZE, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_CASCADE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_BRINGTOFRONT, MF_BYCOMMAND|MF_ENABLED); } else if (count > 1) { EnableMenuItem(hSubMenu, ID_WINDOWS_TILEHORIZONTALLY, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_TILEVERTICALLY, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_MINIMIZE, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_MAXIMIZE, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_CASCADE, MF_BYCOMMAND|MF_ENABLED); EnableMenuItem(hSubMenu, ID_WINDOWS_BRINGTOFRONT, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); } else { EnableMenuItem(hSubMenu, ID_WINDOWS_TILEHORIZONTALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_TILEVERTICALLY, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_MINIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_MAXIMIZE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_CASCADE, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); EnableMenuItem(hSubMenu, ID_WINDOWS_BRINGTOFRONT, MF_BYCOMMAND|MF_DISABLED|MF_GRAYED); } SetMenuDefaultItem(hSubMenu, ID_APPLICATION_PAGE_SWITCHTO, MF_BYCOMMAND); TrackPopupMenu(hSubMenu, TPM_LEFTALIGN|TPM_TOPALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, hMainWnd, NULL); DestroyMenu(hMenu); }
void ApplicationPageShowContextMenu1(void) { HMENU hMenu; HMENU hSubMenu; POINT pt; GetCursorPos(&pt); hMenu = LoadMenuW(hInst, MAKEINTRESOURCEW(IDR_APPLICATION_PAGE_CONTEXT1)); hSubMenu = GetSubMenu(hMenu, 0); CheckMenuRadioItem(hSubMenu, ID_VIEW_LARGE, ID_VIEW_DETAILS, TaskManagerSettings.ViewMode, MF_BYCOMMAND); TrackPopupMenu(hSubMenu, TPM_LEFTALIGN|TPM_TOPALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, hMainWnd, NULL); DestroyMenu(hMenu); }
void MainWnd_OnAbout(HWND hwnd) { WCHAR szAbout[MAX_PATH]; LoadStringW(g_hInstance, IDS_ABOUT, szAbout, _countof(szAbout)); MSGBOXPARAMS Params; ZeroMemory(&Params, sizeof(Params)); Params.cbSize = sizeof(Params); Params.hwndOwner = hwnd; Params.hInstance = g_hInstance; Params.lpszText = szAbout; Params.lpszCaption = g_szTitle; Params.dwStyle = MB_OK | MB_USERICON; Params.lpszIcon = MAKEINTRESOURCEW(1); Params.dwLanguageId = LANG_USER_DEFAULT; MessageBoxIndirectW(&Params); }
/* * @implemented */ DWORD WINAPI drvCommConfigDialogW(LPCWSTR lpszDevice, HWND hWnd, LPCOMMCONFIG lpCommConfig) { DIALOG_INFO DialogInfo; if(!lpszDevice || !lpCommConfig) { return ERROR_INVALID_PARAMETER; } DialogInfo.lpszDevice = lpszDevice; DialogInfo.lpCC = lpCommConfig; return DialogBoxParamW(hDllInstance, MAKEINTRESOURCEW(IDD_COMMDLG), hWnd, (DLGPROC)CommDlgProc, (LPARAM)&DialogInfo); }
csMenu::csMenu() : m_lRefCount() , _files() , _menuBitmap(NULL) { InterlockedIncrement(&g_lDllRefCount); const int iconWidth = GetSystemMetrics(SM_CXMENUCHECK); const int iconHeight = GetSystemMetrics(SM_CYMENUCHECK); HICON icon = (HICON)LoadImageW(g_hDllInst, MAKEINTRESOURCEW(IDI_csMenu), IMAGE_ICON, iconWidth, iconHeight, 0); if( icon != NULL ) { _menuBitmap = createBitmapFromIcon(icon, iconWidth, iconHeight); DestroyIcon(icon); } }
static VOID NT5_DrawLogoffIcon(HDC hdcMem) { HBITMAP hBitmap; BITMAP bitmap; HDC hTempDC; /* Load the XP logo */ hBitmap = (HBITMAP)LoadImageW(g_pInfo->hInstance, MAKEINTRESOURCEW(IDB_MAIN_ROS_LOGO), IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR); if (hBitmap) { /* Get the bitmap dimensions */ GetObjectW(hBitmap, sizeof(BITMAP), &bitmap); /* Create a temp DC for the bitmap */ hTempDC = CreateCompatibleDC(hdcMem); if (hTempDC) { /* Select the bitmap onto the temp DC */ SelectObject(hTempDC, hBitmap); /* Paint it onto the centre block */ BitBlt(hdcMem, (g_pInfo->cx / 2) + 35, (g_pInfo->cy / 2) - 72, bitmap.bmWidth, bitmap.bmHeight, hTempDC, 0, 0, SRCCOPY); /* Delete the DC */ DeleteDC(hTempDC); } /* Delete the bitmap */ DeleteObject(hBitmap); } }
LONG CALLBACK SystemApplet(VOID) { PGLOBAL_DATA pGlobalData; PROPSHEETPAGE psp[5]; PROPSHEETHEADER psh; TCHAR Caption[1024]; INT ret; LoadString(hApplet, IDS_CPLSYSTEMNAME, Caption, sizeof(Caption) / sizeof(TCHAR)); pGlobalData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(GLOBAL_DATA)); if (pGlobalData == NULL) return 0; if (!ReadSettings(pGlobalData)) { HeapFree(GetProcessHeap(), 0, pGlobalData); return 0; } ZeroMemory(&psh, sizeof(PROPSHEETHEADER)); psh.dwSize = sizeof(PROPSHEETHEADER); psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USEICONID | PSH_USECALLBACK; psh.hwndParent = hCPLWindow; psh.hInstance = hApplet; psh.pszIcon = MAKEINTRESOURCEW(IDI_CPLACCESS); psh.pszCaption = Caption; psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGE); psh.nStartPage = 0; psh.ppsp = psp; psh.pfnCallback = PropSheetProc; InitPropSheetPage(&psp[0], IDD_PROPPAGEKEYBOARD, KeyboardPageProc, pGlobalData); InitPropSheetPage(&psp[1], IDD_PROPPAGESOUND, SoundPageProc, pGlobalData); InitPropSheetPage(&psp[2], IDD_PROPPAGEDISPLAY, DisplayPageProc, pGlobalData); InitPropSheetPage(&psp[3], IDD_PROPPAGEMOUSE, MousePageProc, pGlobalData); InitPropSheetPage(&psp[4], IDD_PROPPAGEGENERAL, GeneralPageProc, pGlobalData); ret = PropertySheet(&psh); HeapFree(GetProcessHeap(), 0, pGlobalData); return (LONG)(ret != -1); }
BOOL OpenRDPConnectDialog(HINSTANCE hInstance, PRDPSETTINGS pRdpSettings) { INITCOMMONCONTROLSEX iccx; hInst = hInstance; iccx.dwSize = sizeof(INITCOMMONCONTROLSEX); iccx.dwICC = ICC_TAB_CLASSES; InitCommonControlsEx(&iccx); return (DialogBoxParamW(hInst, MAKEINTRESOURCEW(IDD_CONNECTDIALOG), NULL, DlgProc, (LPARAM)pRdpSettings) == IDOK); }
BOOL DownloadApplication(INT Index) { if (!IS_AVAILABLE_ENUM(SelectedEnumType)) return FALSE; AppInfo = (PAPPLICATION_INFO) ListViewGetlParam(Index); if (!AppInfo) return FALSE; WriteLogMessage(EVENTLOG_SUCCESS, MSG_SUCCESS_INSTALL, AppInfo->szName); DialogBoxW(hInst, MAKEINTRESOURCEW(IDD_DOWNLOAD_DIALOG), hMainWnd, DownloadDlgProc); return TRUE; }
void editSetting(MCONTACT hContact, char* module, char* setting) { DBVARIANT dbv = { 0 }; // freed in the dialog if (!GetSetting(hContact, module, setting, &dbv)) { struct DBsetting *dbsetting = (struct DBsetting *)mir_alloc(sizeof(struct DBsetting)); // gets free()ed in the window proc dbsetting->dbv = dbv; // freed in the dialog dbsetting->hContact = hContact; dbsetting->module = mir_tstrdup(module); dbsetting->setting = mir_tstrdup(setting); if (dbv.type == DBVT_UTF8) CreateDialogParamW(hInst, MAKEINTRESOURCEW(IDD_EDIT_SETTING), hwnd2mainWindow, EditSettingDlgProc, (LPARAM)dbsetting); else CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_EDIT_SETTING), hwnd2mainWindow, EditSettingDlgProc, (LPARAM)dbsetting); } }
static void on_edit_click(HWND hwnd) { INT_PTR ret; int index = SendDlgItemMessageW(hwnd, IDC_DLLS_LIST, LB_GETCURSEL, 0, 0); struct dll *dll; DWORD id; /* if no override is selected the edit button should be disabled... */ assert(index != -1); dll = (struct dll *) SendDlgItemMessageW(hwnd, IDC_DLLS_LIST, LB_GETITEMDATA, index, 0); id = mode_to_id(dll->mode); ret = DialogBoxParamW(0, MAKEINTRESOURCEW(IDD_LOADORDER), hwnd, loadorder_dlgproc, id); if(ret != IDCANCEL) set_dllmode(hwnd, ret); }