这篇教程C++ GetProp函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GetProp函数的典型用法代码示例。如果您正苦于以下问题:C++ GetProp函数的具体用法?C++ GetProp怎么用?C++ GetProp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GetProp函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: UserAuthDialogFunc/* * DialogProc for OpenVPN username/password/challenge auth dialog windows */INT_PTR CALLBACKUserAuthDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){ auth_param_t *param; WCHAR username[USER_PASS_LEN]; WCHAR password[USER_PASS_LEN]; switch (msg) { case WM_INITDIALOG: /* Set connection for this dialog and show it */ param = (auth_param_t *) lParam; SetProp(hwndDlg, cfgProp, (HANDLE) param); if (param->challenge_str) { int wchars_num = MultiByteToWideChar(CP_UTF8, 0, param->challenge_str, -1, NULL, 0); LPWSTR wstr = (LPWSTR)malloc(sizeof(WCHAR) * wchars_num); HWND wnd_challenge = GetDlgItem(hwndDlg, ID_EDT_AUTH_CHALLENGE); MultiByteToWideChar(CP_UTF8, 0, param->challenge_str, -1, wstr, wchars_num); SetDlgItemTextW(hwndDlg, ID_TXT_AUTH_CHALLENGE, wstr); free(wstr); /* Set/Remove style ES_PASSWORD by SetWindowLong(GWL_STYLE) does nothing, send EM_SETPASSWORDCHAR just works. */ if(param->challenge_echo) SendMessage(wnd_challenge, EM_SETPASSWORDCHAR, 0, 0); } if (RecallUsername(param->c->config_name, username)) SetDlgItemTextW(hwndDlg, ID_EDT_AUTH_USER, username); if (RecallAuthPass(param->c->config_name, password)) { SetDlgItemTextW(hwndDlg, ID_EDT_AUTH_PASS, password); SecureZeroMemory(password, sizeof(password)); } if (param->c->flags & FLAG_SAVE_AUTH_PASS) Button_SetCheck(GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); if (param->c->state == resuming) ForceForegroundWindow(hwndDlg); else SetForegroundWindow(hwndDlg); break; case WM_COMMAND: param = (auth_param_t *) GetProp(hwndDlg, cfgProp); switch (LOWORD(wParam)) { case ID_EDT_AUTH_USER: if (HIWORD(wParam) == EN_UPDATE) { int len = Edit_GetTextLength((HWND) lParam); EnableWindow(GetDlgItem(hwndDlg, IDOK), (len ? TRUE : FALSE)); } break; case ID_CHK_SAVE_PASS: param->c->flags ^= FLAG_SAVE_AUTH_PASS; if (param->c->flags & FLAG_SAVE_AUTH_PASS) Button_SetCheck(GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); else { DeleteSavedAuthPass(param->c->config_name); Button_SetCheck(GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_UNCHECKED); } break; case IDOK: if (GetDlgItemTextW(hwndDlg, ID_EDT_AUTH_USER, username, _countof(username))) { SaveUsername(param->c->config_name, username); } if ( param->c->flags & FLAG_SAVE_AUTH_PASS && GetDlgItemTextW(hwndDlg, ID_EDT_AUTH_PASS, password, _countof(password)) && wcslen(password) ) { SaveAuthPass(param->c->config_name, password); SecureZeroMemory(password, sizeof(password)); } ManagementCommandFromInput(param->c, "username /"Auth/" /"%s/"", hwndDlg, ID_EDT_AUTH_USER); if (param->challenge_str) ManagementCommandFromInputBase64(param->c, "password /"Auth/" /"SCRV1:%s:%s/"", hwndDlg, ID_EDT_AUTH_PASS, ID_EDT_AUTH_CHALLENGE); else ManagementCommandFromInput(param->c, "password /"Auth/" /"%s/"", hwndDlg, ID_EDT_AUTH_PASS); EndDialog(hwndDlg, LOWORD(wParam)); return TRUE; case IDCANCEL: EndDialog(hwndDlg, LOWORD(wParam)); StopOpenVPN(param->c); return TRUE; } break; case WM_CLOSE: EndDialog(hwndDlg, LOWORD(wParam)); return TRUE;//.........这里部分代码省略.........
开发者ID:selvanair,项目名称:openvpn-gui,代码行数:101,
示例2: _HyperlinkProc/* * Function CHyperLink::_HyperlinkProc * * Note: Processed messages are not passed back to the static control * procedure. It does work fine but be aware that it could cause * some problems if the static control is already subclassed. * Consider the example where the static control would be already * subclassed with the ToolTip control that needs to process mouse * messages. In that situation, the ToolTip control would not work * as expected. */LRESULT CALLBACK CHyperLink::_HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ CHyperLink *pHyperLink = (CHyperLink *)GetProp(hwnd, PROP_OBJECT_PTR); switch (message) { case WM_MOUSEMOVE: { if ( pHyperLink->m_bOverControl ) { // This is the most common case for static branch prediction // optimization RECT rect; GetClientRect(hwnd,&rect); POINT pt = { LOWORD(lParam), HIWORD(lParam) }; if (!PTINRECT(&rect,pt)) { ReleaseCapture(); } } else { pHyperLink->m_bOverControl = TRUE; SendMessage(hwnd, WM_SETFONT, (WPARAM)CHyperLink::g_UnderlineFont, FALSE); InvalidateRect(hwnd, NULL, FALSE); pHyperLink->OnSelect(); SetCapture(hwnd); } return 0; } case WM_SETCURSOR: { SetCursor(CHyperLink::g_hLinkCursor); return TRUE; } case WM_CAPTURECHANGED: { pHyperLink->m_bOverControl = FALSE; pHyperLink->OnDeselect(); SendMessage(hwnd, WM_SETFONT, (WPARAM)pHyperLink->m_StdFont, FALSE); InvalidateRect(hwnd, NULL, FALSE); return 0; } case WM_KEYUP: { if( wParam != VK_SPACE ) { break; } } // Fall through case WM_LBUTTONUP: { pHyperLink->Navigate(); return 0; } case WM_SETFOCUS: // Fall through case WM_KILLFOCUS: { if( message == WM_SETFOCUS ) { pHyperLink->OnSelect(); } else // WM_KILLFOCUS { pHyperLink->OnDeselect(); } CHyperLink::DrawFocusRect(hwnd); return 0; } case WM_DESTROY: { SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG) pHyperLink->m_pfnOrigCtlProc); SendMessage(hwnd, WM_SETFONT, (WPARAM) pHyperLink->m_StdFont, 0); if( --CHyperLink::g_counter <= 0 ) { destroyGlobalResources(); } RemoveProp(hwnd, PROP_OBJECT_PTR); break;//.........这里部分代码省略.........
开发者ID:chengn,项目名称:TortoiseGit,代码行数:101,
示例3: HookHandleinline BOOL HookHandle(UINT MessageId, HWND hWnd, WPARAM wParam, LPARAM lParam){ //////////////////////////////////////////////////////////////// // *** HANDLE DEFERRED UPDATES *** // Is this a deferred-update message? if (MessageId == VNC_DEFERRED_UPDATE) { // NOTE : NEVER use the SendDeferred- routines to send updates // from here, or you'll get an infinite loop....! // NB : The format of DEFERRED_UPDATE matches that of UpdateRectMessage, // so just send the exact same message data to WinRFB: PostMessage( hVeneto, UpdateRectMessage, wParam, lParam ); return FALSE; } // *** Could use WM_COPYDATA to send data to WinVNC/* if (GetClassLong(hWnd, GCW_ATOM) == 32768) { _RPT4(_CRT_WARN, "DBG : popup menu message (hwnd=%d, msg=%d, l=%d, w=%d)/n", hWnd, MessageId, lParam, wParam); }*/ //////////////////////////////////////////////////////////////// // *** UPDATE-TRIGGERING MESSAGES *** // Do something dependent upon message type switch (MessageId) { //////////////////////////////////////////////////////////////// // Messages indicating only a border repaint. case WM_NCPAINT: case WM_NCACTIVATE: SendDeferredBorderRect(hWnd); break; //////////////////////////////////////////////////////////////// // Messages indicating a client area repaint case WM_CHAR: case WM_KEYUP: // Handle key-presses if (prf_use_KeyPress) SendDeferredWindowRect(hWnd); break; case WM_LBUTTONUP: // Handle LMB clicks if (prf_use_LButtonUp) SendDeferredWindowRect(hWnd); break; case WM_MBUTTONUP: // Handle MMB clicks if (prf_use_MButtonUp) SendDeferredWindowRect(hWnd); break; case WM_RBUTTONUP: // Handle RMB clicks if (prf_use_RButtonUp) SendDeferredWindowRect(hWnd); break; case WM_TIMER: if (prf_use_Timer) SendDeferredWindowRect(hWnd); break; case WM_HSCROLL: case WM_VSCROLL: if (((int) LOWORD(wParam) == SB_THUMBTRACK) || ((int) LOWORD(wParam) == SB_ENDSCROLL)) SendDeferredWindowRect(hWnd); break; case 485: // HACK to handle popup menus { // Get the old popup menu selection value HANDLE prop = GetProp(hWnd, (LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0)); if (prop != (HANDLE) wParam) { // It did, so update the menu & the selection value SendDeferredWindowRect(hWnd); SetProp(hWnd, (LPCTSTR) MAKELONG(VNC_POPUPSELN_ATOM, 0), (HANDLE) wParam); } } break; //////////////////////////////////////////////////////////////// // Messages indicating a full window update//.........这里部分代码省略.........
开发者ID:tmbx,项目名称:vnc,代码行数:101,
示例4: DialogBoxSubclassProc//.........这里部分代码省略......... break; } SendMessage(hwndHelpDlg, M_CHANGEHELPCONTROL, 0, (LPARAM)hwndDlg); return 0; } break; case WM_CONTEXTMENU: { POINT pt; struct FindChildAtPointData fcap; // workaround for badly coded plugins that do display a context menu // and pass the message to DefWindowProc afterwards (doing a "break;"). if (GetTickCount() - GetMessageTime()>10) return 0; if (idMouseMoveTimer) KillTimer(NULL, idMouseMoveTimer); idMouseMoveTimer = 0; ZeroMemory(&fcap, sizeof(fcap)); POINTSTOPOINT(pt, MAKEPOINTS(lParam)); // ChildWindowFromPoint() messes up with group boxes fcap.hwnd = NULL; fcap.pt = pt; EnumChildWindows(hwndDlg, FindChildAtPointEnumProc, (LPARAM)&fcap); HWND hwndCtl = fcap.hwnd; if (hwndCtl == NULL) { ScreenToClient(hwndDlg, &pt); hwndCtl = ChildWindowFromPointEx(hwndDlg, pt, CWP_SKIPINVISIBLE); if (hwndCtl == NULL) break; POINTSTOPOINT(pt, MAKEPOINTS(lParam)); } { LONG_PTR flags = (LONG_PTR)GetProp(hwndCtl, PROP_CONTEXTSTATE); if (flags&PROPF_MENUDISABLED) break; else if (!(flags&PROPF_MENUFORCED)) { int type = GetControlType(hwndCtl); // showing a context menu on these looks silly (multi components) if (type == CTLTYPE_TOOLBAR || type == CTLTYPE_LISTVIEW || type == CTLTYPE_TREEVIEW || type == CTLTYPE_STATUSBAR || type == CTLTYPE_CLC) break; } } if (IsRealChild(hwndDlg, hwndCtl)) { HMENU hMenu = CreatePopupMenu(); AppendMenu(hMenu, MF_STRING, SC_CONTEXTHELP, (hwndCtl == hwndDlg) ? TranslateT("&What's this dialog?") : TranslateT("&What's this?")); if (TrackPopupMenuEx(hMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_HORPOSANIMATION | TPM_VERPOSANIMATION | TPM_RIGHTBUTTON | TPM_RETURNCMD | TPM_NONOTIFY, pt.x, pt.y, hwndDlg, NULL)) { if (hwndHelpDlg == NULL) { hwndHelpDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_HELP), NULL, HelpDlgProc); if (hwndHelpDlg == NULL) { DestroyMenu(hMenu); break; } } SendMessage(hwndHelpDlg, M_CHANGEHELPCONTROL, 0, (LPARAM)hwndCtl); } DestroyMenu(hMenu); } return 0; } case WM_HELP: { HELPINFO *hi = (HELPINFO*)lParam; if (hi->iContextType != HELPINFO_WINDOW) break; // fix for SHBrowseForFolder() dialog, which sends unhandled help to parent if (!IsRealChild(hwndDlg, (HWND)hi->hItemHandle)) break; if (idMouseMoveTimer) KillTimer(NULL, idMouseMoveTimer); idMouseMoveTimer = 0; if (!IsWindow(hwndHelpDlg)) { hwndHelpDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_HELP), NULL, HelpDlgProc); if (hwndHelpDlg == NULL) break; } SendMessage(hwndHelpDlg, M_CHANGEHELPCONTROL, 0, (LPARAM)hi->hItemHandle); // we need to eat the next WM_LBUTTONDOWN (if invoked by mouse) if (GetKeyState(GetSystemMetrics(SM_SWAPBUTTON) ? VK_RBUTTON : VK_LBUTTON) & 0x8000 && hEatNextMouseHook == NULL) hEatNextMouseHook = SetWindowsHookEx(WH_MOUSE, EatNextMouseButtonUpHookProc, NULL, GetCurrentThreadId()); return TRUE; } case WM_NCDESTROY: if (idMouseMoveTimer) KillTimer(NULL, idMouseMoveTimer); idMouseMoveTimer = 0; EnumChildWindows(hwndDlg, RemovePropForAllChildsEnumProc, (LPARAM)PROP_CONTEXTSTATE); { TCHAR text[64]; mir_sntprintf(text, _countof(text), _T("unhooked window 0x%X for context help/n"), hwndDlg); OutputDebugString(text); } SetWindowLongPtr(hwndDlg, GWLP_WNDPROC, (LONG_PTR)pfnWndProc); break; } return CallWindowProc(pfnWndProc, hwndDlg, msg, wParam, lParam);}
开发者ID:wyrover,项目名称:miranda-ng,代码行数:101,
示例5: winMWExtWMWindowProcLRESULT CALLBACKwinMWExtWMWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ WindowPtr pWin = NULL; win32RootlessWindowPtr pRLWinPriv = NULL; ScreenPtr pScreen = NULL; winPrivScreenPtr pScreenPriv = NULL; winScreenInfo *pScreenInfo = NULL; HWND hwndScreen = NULL; POINT ptMouse; static Bool s_fTracking = FALSE; HDC hdcUpdate; PAINTSTRUCT ps; LPWINDOWPOS pWinPos = NULL; RECT rcClient; winWMMessageRec wmMsg; Bool fWMMsgInitialized = FALSE; /* Check if the Windows window property for our X window pointer is valid */ if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL) { pWin = pRLWinPriv->pFrame->win; pScreen = pWin->drawable.pScreen; if (pScreen) pScreenPriv = winGetScreenPriv(pScreen); if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo; if (pScreenPriv) hwndScreen = pScreenPriv->hwndScreen; wmMsg.msg = 0; wmMsg.hwndWindow = hwnd; wmMsg.iWindow = (Window)pWin->drawable.id; wmMsg.iX = pRLWinPriv->pFrame->x; wmMsg.iY = pRLWinPriv->pFrame->y; wmMsg.iWidth = pRLWinPriv->pFrame->width; wmMsg.iHeight = pRLWinPriv->pFrame->height; fWMMsgInitialized = TRUE;#if CYGDEBUG winDebugWin32Message("winMWExtWMWindowProc", hwnd, message, wParam, lParam); winDebug ("/thWnd %08X/n", hwnd); winDebug ("/tpScreenPriv %08X/n", pScreenPriv); winDebug ("/tpScreenInfo %08X/n", pScreenInfo); winDebug ("/thwndScreen %08X/n", hwndScreen); winDebug ("winMWExtWMWindowProc (%08x) %08x %08x %08x/n", pRLWinPriv, message, wParam, lParam);#endif } /* Branch on message type */ switch (message) { case WM_CREATE:#if CYGMULTIWINDOW_DEBUG winDebug ("winMWExtWMWindowProc - WM_CREATE/n");#endif /* */ SetProp (hwnd, WIN_WINDOW_PROP, (HANDLE)((LPCREATESTRUCT) lParam)->lpCreateParams); return 0; case WM_CLOSE:#if CYGMULTIWINDOW_DEBUG winDebug ("winMWExtWMWindowProc - WM_CLOSE %d/n", pRLWinPriv->fClose);#endif /* Tell window-manager to close window */ if (pRLWinPriv->fClose) { DestroyWindow (hwnd); } else { if (winIsInternalWMRunning(pScreenInfo)) { /* Tell our Window Manager thread to kill the window */ wmMsg.msg = WM_WM_KILL; if (fWMMsgInitialized) winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg); } winWindowsWMSendEvent(WindowsWMControllerNotify, WindowsWMControllerNotifyMask, 1, WindowsWMCloseWindow, pWin->drawable.id, 0, 0, 0, 0); } return 0; case WM_DESTROY:#if CYGMULTIWINDOW_DEBUG winDebug ("winMWExtWMWindowProc - WM_DESTROY/n");#endif /* Free the shaodw DC; which allows the bitmap to be freed */ DeleteDC (pRLWinPriv->hdcShadow); pRLWinPriv->hdcShadow = NULL; /* Free the shadow bitmap */ DeleteObject (pRLWinPriv->hbmpShadow); pRLWinPriv->hbmpShadow = NULL;//.........这里部分代码省略.........
开发者ID:Agnarr,项目名称:xserver,代码行数:101,
示例6: winWindowProcLRESULT CALLBACKwinWindowProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ static winPrivScreenPtr s_pScreenPriv = NULL; static winScreenInfo *s_pScreenInfo = NULL; static ScreenPtr s_pScreen = NULL; static HWND s_hwndLastPrivates = NULL; static HINSTANCE s_hInstance; static Bool s_fTracking = FALSE; static unsigned long s_ulServerGeneration = 0; int iScanCode; int i; /* Watch for server regeneration */ if (g_ulServerGeneration != s_ulServerGeneration) { /* Store new server generation */ s_ulServerGeneration = g_ulServerGeneration; } /* Only retrieve new privates pointers if window handle is null or changed */ if ((s_pScreenPriv == NULL || hwnd != s_hwndLastPrivates) && (s_pScreenPriv = GetProp (hwnd, WIN_SCR_PROP)) != NULL) {#if CYGDEBUG ErrorF ("winWindowProc - Setting privates handle/n");#endif s_pScreenInfo = s_pScreenPriv->pScreenInfo; s_pScreen = s_pScreenInfo->pScreen; s_hwndLastPrivates = hwnd; } else if (s_pScreenPriv == NULL) { /* For safety, handle case that should never happen */ s_pScreenInfo = NULL; s_pScreen = NULL; s_hwndLastPrivates = NULL; } /* Branch on message type */ switch (message) { case WM_TRAYICON: return winHandleIconMessage (hwnd, message, wParam, lParam, s_pScreenPriv); case WM_CREATE:#if CYGDEBUG ErrorF ("winWindowProc - WM_CREATE/n");#endif /* * Add a property to our display window that references * this screens' privates. * * This allows the window procedure to refer to the * appropriate window DC and shadow DC for the window that * it is processing. We use this to repaint exposed * areas of our display window. */ s_pScreenPriv = ((LPCREATESTRUCT) lParam)->lpCreateParams; s_hInstance = ((LPCREATESTRUCT) lParam)->hInstance; s_pScreenInfo = s_pScreenPriv->pScreenInfo; s_pScreen = s_pScreenInfo->pScreen; s_hwndLastPrivates = hwnd; SetProp (hwnd, WIN_SCR_PROP, s_pScreenPriv); /* Store the mode key states so restore doesn't try to restore them */ winStoreModeKeyStates (s_pScreen); /* Setup tray icon */ if (!s_pScreenInfo->fNoTrayIcon) { /* * NOTE: The WM_CREATE message is processed before CreateWindowEx * returns, so s_pScreenPriv->hwndScreen is invalid at this point. * We go ahead and copy our hwnd parameter over top of the screen * privates hwndScreen so that we have a valid value for * that member. Otherwise, the tray icon will disappear * the first time you move the mouse over top of it. */ s_pScreenPriv->hwndScreen = hwnd; winInitNotifyIcon (s_pScreenPriv); } return 0; case WM_DISPLAYCHANGE: /* We cannot handle a display mode change during initialization */ if (s_pScreenInfo == NULL) FatalError ("winWindowProc - WM_DISPLAYCHANGE - The display " "mode changed while we were intializing. This is " "very bad and unexpected. Exiting./n"); /* * We do not care about display changes with * fullscreen DirectDraw engines, because those engines set * their own mode when they become active.//.........这里部分代码省略.........
开发者ID:aosm,项目名称:X11,代码行数:101,
示例7: _docsumparamsConfig::Config(const char* config_name, Juniper & juniper) : _docsumparams(), _matcherparams(), _sumconf(NULL), _config_name(config_name), _juniper(juniper){ std::string separators = ""; separators += UNIT_SEPARATOR; separators += GROUP_SEPARATOR; const char* high_on = GetProp("dynsum.highlight_on", "<b>"); const char* high_off = GetProp("dynsum.highlight_off", "</b>"); const char* contsym = GetProp("dynsum.continuation", "..."); const char* fallback = GetProp("dynsum.fallback", "none"); size_t summarylength = atoi(GetProp("dynsum.length", "256")); size_t sum_minlength = atoi(GetProp("dynsum.min_length", "128")); size_t stem_min = atoi(GetProp("stem.min_length", "5")); size_t stem_extend = atoi(GetProp("stem.max_extend", "3")); size_t surround_max = atoi(GetProp("dynsum.surround_max", "128")); size_t max_matches = atoi(GetProp("dynsum.max_matches", "3")); const char* escape_markup = GetProp("dynsum.escape_markup", "auto"); const char* preserve_white_space = GetProp("dynsum.preserve_white_space", "off"); size_t match_winsize = strtol(GetProp("matcher.winsize", "200"), NULL, 0); size_t max_match_candidates = atoi(GetProp("matcher.max_match_candidates", "1000")); const char* seps = GetProp("dynsum.separators", separators.c_str()); const unsigned char* cons = reinterpret_cast<const unsigned char*>(GetProp("dynsum.connectors", separators.c_str())); double proximity_factor = vespalib::locale::c::strtod(GetProp("proximity.factor", "0.25"), NULL); // Silently convert to something sensible if (proximity_factor > 1E8 || proximity_factor < 0) proximity_factor = 0.25; _sumconf = CreateSummaryConfig(high_on, high_off, contsym, seps, cons, StringToConfigFlag(escape_markup), StringToConfigFlag(preserve_white_space)); _docsumparams.SetEnabled(true) .SetLength(summarylength).SetMinLength(sum_minlength) .SetMaxMatches(max_matches) .SetSurroundMax(surround_max) .SetFallback(fallback); _matcherparams.SetWantGlobalRank(true) .SetStemMinLength(stem_min).SetStemMaxExtend(stem_extend) .SetMatchWindowSize(match_winsize) .SetMaxMatchCandidates(max_match_candidates) .SetWordFolder(& _juniper.getWordFolder()) .SetProximityFactor(proximity_factor);}
开发者ID:songhtdo,项目名称:vespa,代码行数:47,
示例8: DirList_Fill//=============================================================================//// DirList_Fill()//// Snapshots a directory and displays the items in the listview control//int DirList_Fill(HWND hwnd,LPCWSTR lpszDir,DWORD grfFlags,LPCWSTR lpszFileSpec, BOOL bExcludeFilter,BOOL bNoFadeHidden, int iSortFlags,BOOL fSortRev){ WCHAR wszDir[MAX_PATH]; LPSHELLFOLDER lpsfDesktop = NULL; LPSHELLFOLDER lpsf = NULL; LPITEMIDLIST pidl = NULL; LPITEMIDLIST pidlEntry = NULL; LPENUMIDLIST lpe = NULL; LV_ITEM lvi; LPLV_ITEMDATA lplvid; ULONG chParsed = 0; ULONG dwAttributes = 0; DL_FILTER dlf; SHFILEINFO shfi; LPDLDATA lpdl = (LPVOID)GetProp(hwnd,pDirListProp); // Initialize default icons SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_DIRECTORY,&shfi,sizeof(SHFILEINFO), SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX); lpdl->iDefIconFolder = shfi.iIcon; SHGetFileInfo(L"Icon",FILE_ATTRIBUTE_NORMAL,&shfi,sizeof(SHFILEINFO), SHGFI_USEFILEATTRIBUTES | SHGFI_SMALLICON | SHGFI_SYSICONINDEX); lpdl->iDefIconFile = shfi.iIcon; // First of all terminate running icon thread DirList_TerminateIconThread(hwnd); // A Directory is strongly required if (!lpszDir || !*lpszDir) return(-1); lstrcpy(lpdl->szPath,lpszDir); // Init ListView SendMessage(hwnd,WM_SETREDRAW,0,0); ListView_DeleteAllItems(hwnd); // Init Filter DirList_CreateFilter(&dlf,lpszFileSpec,bExcludeFilter); // Init lvi lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM; lvi.iItem = 0; lvi.iSubItem = 0; lvi.pszText = LPSTR_TEXTCALLBACK; lvi.cchTextMax = MAX_PATH; lvi.iImage = I_IMAGECALLBACK; // Convert Directory to a UNICODE string /*MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, lpszDir, -1, wszDir, MAX_PATH);*/ lstrcpy(wszDir,lpszDir); // Get Desktop Folder if (NOERROR == SHGetDesktopFolder(&lpsfDesktop)) { // Convert wszDir into a pidl if (NOERROR == lpsfDesktop->lpVtbl->ParseDisplayName( lpsfDesktop, hwnd, NULL, wszDir, &chParsed, &pidl, &dwAttributes)) { // Bind pidl to IShellFolder if (NOERROR == lpsfDesktop->lpVtbl->BindToObject( lpsfDesktop, pidl, NULL, &IID_IShellFolder, &lpsf)) {//.........这里部分代码省略.........
开发者ID:ziembla,项目名称:notepad2-replacement-edition,代码行数:101,
示例9: SetPropINT_PTR CALLBACK CRegisterTabs::TabProcGPR(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam){ if (msg == WM_INITDIALOG) { SetProp(hDlg, "attached", (HANDLE)lParam); return TRUE; } // color textboxes if (msg == WM_CTLCOLOREDIT) { HDC hdc = (HDC)wParam; COLORREF colorBg = RGB(255, 255, 255); COLORREF colorRead = RGB(200, 200, 255); COLORREF colorWrite = RGB(255, 200, 200); COLORREF colorBoth = RGB(220, 170, 255); if (!m_bColorsEnabled || g_Reg == NULL || g_MMU == NULL) { return FALSE; } HWND hWnd = (HWND)lParam; WORD ctrlId = (WORD) ::GetWindowLong(hWnd, GWL_ID); COpInfo opInfo; g_MMU->LW_VAddr(g_Reg->m_PROGRAM_COUNTER, opInfo.m_OpCode.Hex); bool bOpReads = false; bool bOpWrites = false; if (ctrlId == IDC_LO_EDIT) { bOpReads = opInfo.ReadsLO(); bOpWrites = !bOpReads && opInfo.WritesLO(); } else if (ctrlId == IDC_HI_EDIT) { bOpReads = opInfo.ReadsHI(); bOpWrites = !bOpReads && opInfo.WritesHI(); } else { int nReg = GetCtrlRegNum(ctrlId, GPREditIds); if (nReg == -1) { return (LRESULT)GetStockObject(DC_BRUSH); } int nRegRead1, nRegRead2, nRegWrite; opInfo.ReadsGPR(&nRegRead1, &nRegRead2); opInfo.WritesGPR(&nRegWrite); bOpReads = (nReg == nRegRead1) || (nReg == nRegRead2); bOpWrites = (nReg == nRegWrite); } if (bOpReads && bOpWrites) { colorBg = colorBoth; } else if (bOpReads) { colorBg = colorRead; } else if (bOpWrites) { colorBg = colorWrite; } SetBkColor(hdc, colorBg); SetDCBrushColor(hdc, colorBg); return (LRESULT)GetStockObject(DC_BRUSH); } if (msg == WM_COMMAND && HIWORD(wParam) == EN_KILLFOCUS) { bool * attached = (bool *)GetProp(hDlg, "attached"); if (attached != NULL && *attached) { RegisterChanged(hDlg, TabGPR, wParam); } return FALSE; } // right click labels if (msg == WM_CONTEXTMENU) { HWND hWnd = (HWND)wParam; WORD ctrlId = (WORD) ::GetWindowLong(hWnd, GWL_ID); CBreakpoints* breakpoints = m_Debugger->Breakpoints(); if (ctrlId == IDC_HI_LBL) { breakpoints->ToggleHIWriteBP();//.........这里部分代码省略.........
开发者ID:Azimer,项目名称:project64,代码行数:101,
示例10: NotifyInitWndProc//---------------------------------------------------------------------------LRESULT __stdcall NotifyInitWndProc(HWND Win,UINT Mess,WPARAM wPar,LPARAM lPar){ switch (Mess){#ifndef ONEGAME case WM_CREATE: { char *Text=new char[200]; strcpy(Text,T("Please wait...")); SetProp(Win,"NotifyText",Text); break; } case WM_PAINT: { HDC DC; RECT rc; char *Text; SIZE sz; GetClientRect(Win,&rc); DC=GetDC(Win); SelectObject(DC,GetStockObject(DEFAULT_GUI_FONT)); HBRUSH br=CreateSolidBrush(GetSysColor(COLOR_BTNFACE)); FillRect(DC,&rc,br); DeleteObject(br); SetBkMode(DC,TRANSPARENT); Text=(char*)GetProp(Win,"NotifyText"); GetTextExtentPoint32(DC,Text,strlen(Text),&sz); TextOut(DC,(rc.right-sz.cx)/2,(rc.bottom-sz.cy)/2,Text,strlen(Text)); ReleaseDC(Win,DC); ValidateRect(Win,NULL); return 0; } case WM_USER: if (wPar==12345){ char *Text=(char*)GetProp(Win,"NotifyText"),*NewText=(char*)lPar; delete[] Text; Text=new char[strlen(NewText)+1]; strcpy(Text,NewText); SetProp(Win,"NotifyText",Text); InvalidateRect(Win,NULL,1); } break; case WM_DESTROY: delete[] (char*)GetProp(Win,"NotifyText"); RemoveProp(Win,"NotifyText"); break;#else case WM_PAINT: { HDC DC=GetDC(Win); RECT rc; GetClientRect(Win,&rc); FillRect(DC,&rc,(HBRUSH)GetStockObject(BLACK_BRUSH)); ReleaseDC(Win,DC); ValidateRect(Win,NULL); return 0; } case WM_SETCURSOR: SetCursor(NULL); return TRUE;/* case WM_CREATE: { HBITMAP bmp=LoadBitmap(Inst,RCNUM(2)); HDC SrcDC=GetDC(NULL); HDC dc=CreateCompatibleDC(SrcDC); ReleaseDC(NULL,SrcDC); SelectObject(dc,bmp); SetProp(Win,"BitmapDC",dc); SetProp(Win,"BitmapBMP",bmp); break; } case WM_PAINT: { HDC dc=GetDC(Win); BitBlt(dc,0,0,320,200,(HDC)GetProp(Win,"BitmapDC"),0,0,SRCCOPY); ReleaseDC(Win,dc); ValidateRect(Win,NULL); return 0; } case WM_NCLBUTTONDOWN:case WM_NCRBUTTONDOWN:case WM_NCMBUTTONDOWN: case WM_NCLBUTTONUP:case WM_NCRBUTTONUP:case WM_NCMBUTTONUP: return 0; case WM_DESTROY: DeleteDC((HDC)GetProp(Win,"BitmapDC")); DeleteObject(GetProp(Win,"BitmapBMP")); RemoveProp(Win,"BitmapDC"); RemoveProp(Win,"BitmapBMP"); break;*///.........这里部分代码省略.........
开发者ID:gbouthenot,项目名称:Steem-Engine,代码行数:101,
示例11: NetworkOutputDlgProcstatic INT_PTR CALLBACK NetworkOutputDlgProc( _In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ){ PNETWORK_OUTPUT_CONTEXT context; if (uMsg == WM_INITDIALOG) { context = (PNETWORK_OUTPUT_CONTEXT)lParam; SetProp(hwndDlg, L"Context", (HANDLE)context); } else { context = (PNETWORK_OUTPUT_CONTEXT)GetProp(hwndDlg, L"Context"); if (uMsg == WM_DESTROY) { PhSaveWindowPlacementToSetting(SETTING_NAME_TRACERT_WINDOW_POSITION, SETTING_NAME_TRACERT_WINDOW_SIZE, hwndDlg); PhDeleteLayoutManager(&context->LayoutManager); if (context->ProcessHandle) { // Terminate the child process. PhTerminateProcess(context->ProcessHandle, STATUS_SUCCESS); // Close the child process handle. NtClose(context->ProcessHandle); } // Close the pipe handle. if (context->PipeReadHandle) NtClose(context->PipeReadHandle); RemoveProp(hwndDlg, L"Context"); PhFree(context); } } if (!context) return FALSE; switch (uMsg) { case WM_INITDIALOG: { PH_RECTANGLE windowRectangle; context->WindowHandle = hwndDlg; context->OutputHandle = GetDlgItem(hwndDlg, IDC_NETOUTPUTEDIT); PhInitializeLayoutManager(&context->LayoutManager, hwndDlg); PhAddLayoutItem(&context->LayoutManager, context->OutputHandle, NULL, PH_ANCHOR_ALL); PhAddLayoutItem(&context->LayoutManager, GetDlgItem(hwndDlg, IDC_MORE_INFO), NULL, PH_ANCHOR_BOTTOM | PH_ANCHOR_LEFT); PhAddLayoutItem(&context->LayoutManager, GetDlgItem(hwndDlg, IDOK), NULL, PH_ANCHOR_BOTTOM | PH_ANCHOR_RIGHT); windowRectangle.Position = PhGetIntegerPairSetting(SETTING_NAME_TRACERT_WINDOW_POSITION); windowRectangle.Size = PhGetIntegerPairSetting(SETTING_NAME_TRACERT_WINDOW_SIZE); if (MinimumSize.left == -1) { RECT rect; rect.left = 0; rect.top = 0; rect.right = 190; rect.bottom = 120; MapDialogRect(hwndDlg, &rect); MinimumSize = rect; MinimumSize.left = 0; } // Check for first-run default position. if (windowRectangle.Position.X == 0 || windowRectangle.Position.Y == 0) { PhCenterWindow(hwndDlg, GetParent(hwndDlg)); } else { PhLoadWindowPlacementFromSetting(SETTING_NAME_TRACERT_WINDOW_POSITION, SETTING_NAME_TRACERT_WINDOW_SIZE, hwndDlg); } if (context->IpAddress.Type == PH_IPV4_NETWORK_TYPE) { RtlIpv4AddressToString(&context->IpAddress.InAddr, context->IpAddressString); } else { RtlIpv6AddressToString(&context->IpAddress.In6Addr, context->IpAddressString); } switch (context->Action) { case NETWORK_ACTION_TRACEROUTE: { HANDLE dialogThread = INVALID_HANDLE_VALUE; Static_SetText(context->WindowHandle,//.........这里部分代码省略.........
开发者ID:chosen1,项目名称:ProcessHacker,代码行数:101,
示例12: GetControlPtrLONG GetControlPtr(HWND hWnd) { long rVal = MAKELONG((UINT)GetProp(hWnd, LOPTR), (UINT)GetProp(hWnd, HIPTR)); return rVal; }
开发者ID:benbucksch,项目名称:AppWare,代码行数:5,
示例13: StatusDialogFunc/* * DialogProc for OpenVPN status dialog windows */INT_PTR CALLBACKStatusDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){ connection_t *c; switch (msg) { case WM_MANAGEMENT: /* Management interface related event */ OnManagement(wParam, lParam); return TRUE; case WM_INITDIALOG: c = (connection_t *) lParam; /* Set window icon "disconnected" */ SetStatusWinIcon(hwndDlg, ID_ICO_CONNECTING); /* Set connection for this dialog */ SetProp(hwndDlg, cfgProp, (HANDLE) c); /* Create log window */ HWND hLogWnd = CreateWindowEx(0, RICHEDIT_CLASS, NULL, WS_CHILD|WS_VISIBLE|WS_HSCROLL|WS_VSCROLL|ES_SUNKEN|ES_LEFT| ES_MULTILINE|ES_READONLY|ES_AUTOHSCROLL|ES_AUTOVSCROLL, 20, 25, 350, 160, hwndDlg, (HMENU) ID_EDT_LOG, o.hInstance, NULL); if (!hLogWnd) { ShowLocalizedMsg(IDS_ERR_CREATE_EDIT_LOGWINDOW); return FALSE; } /* Set font and fontsize of the log window */ CHARFORMAT cfm = { .cbSize = sizeof(CHARFORMAT), .dwMask = CFM_SIZE|CFM_FACE|CFM_BOLD, .szFaceName = _T("Microsoft Sans Serif"), .dwEffects = 0, .yHeight = 160 }; if (SendMessage(hLogWnd, EM_SETCHARFORMAT, SCF_DEFAULT, (LPARAM) &cfm) == 0) ShowLocalizedMsg(IDS_ERR_SET_SIZE); /* Set size and position of controls */ RECT rect; GetClientRect(hwndDlg, &rect); MoveWindow(hLogWnd, 20, 25, rect.right - 40, rect.bottom - 70, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_TXT_STATUS), 20, 5, rect.right - 25, 15, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_DISCONNECT), 20, rect.bottom - 30, 110, 23, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_RESTART), 145, rect.bottom - 30, 110, 23, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_HIDE), rect.right - 130, rect.bottom - 30, 110, 23, TRUE); /* Set focus on the LogWindow so it scrolls automatically */ SetFocus(hLogWnd); return FALSE; case WM_SIZE: MoveWindow(GetDlgItem(hwndDlg, ID_EDT_LOG), 20, 25, LOWORD(lParam) - 40, HIWORD(lParam) - 70, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_DISCONNECT), 20, HIWORD(lParam) - 30, 110, 23, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_RESTART), 145, HIWORD(lParam) - 30, 110, 23, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_HIDE), LOWORD(lParam) - 130, HIWORD(lParam) - 30, 110, 23, TRUE); MoveWindow(GetDlgItem(hwndDlg, ID_TXT_STATUS), 20, 5, LOWORD(lParam) - 25, 15, TRUE); InvalidateRect(hwndDlg, NULL, TRUE); return TRUE; case WM_COMMAND: c = (connection_t *) GetProp(hwndDlg, cfgProp); switch (LOWORD(wParam)) { case ID_DISCONNECT: SetFocus(GetDlgItem(c->hwndStatus, ID_EDT_LOG)); StopOpenVPN(c); return TRUE; case ID_HIDE: if (c->state != disconnected) ShowWindow(hwndDlg, SW_HIDE); else DestroyWindow(hwndDlg); return TRUE; case ID_RESTART: c->state = reconnecting; SetFocus(GetDlgItem(c->hwndStatus, ID_EDT_LOG)); ManagementCommand(c, "signal SIGHUP", NULL, regular); return TRUE; } break; case WM_SHOWWINDOW: if (wParam == TRUE) { c = (connection_t *) GetProp(hwndDlg, cfgProp); if (c->hwndStatus) SetFocus(GetDlgItem(c->hwndStatus, ID_EDT_LOG)); } return FALSE;//.........这里部分代码省略.........
开发者ID:selvanair,项目名称:openvpn-gui,代码行数:101,
示例14: PrivKeyPassDialogFunc/* * DialogProc for OpenVPN private key password dialog windows */INT_PTR CALLBACKPrivKeyPassDialogFunc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam){ connection_t *c; WCHAR passphrase[KEY_PASS_LEN]; switch (msg) { case WM_INITDIALOG: /* Set connection for this dialog and show it */ c = (connection_t *) lParam; SetProp(hwndDlg, cfgProp, (HANDLE) c); if (RecallKeyPass(c->config_name, passphrase) && wcslen(passphrase)) { /* Use the saved password and skip the dialog */ SetDlgItemTextW(hwndDlg, ID_EDT_PASSPHRASE, passphrase); SecureZeroMemory(passphrase, sizeof(passphrase)); ManagementCommandFromInput(c, "password /"Private Key/" /"%s/"", hwndDlg, ID_EDT_PASSPHRASE); EndDialog(hwndDlg, IDOK); return TRUE; } if (c->flags & FLAG_SAVE_KEY_PASS) Button_SetCheck (GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); if (c->state == resuming) ForceForegroundWindow(hwndDlg); else SetForegroundWindow(hwndDlg); break; case WM_COMMAND: c = (connection_t *) GetProp(hwndDlg, cfgProp); switch (LOWORD(wParam)) { case ID_CHK_SAVE_PASS: c->flags ^= FLAG_SAVE_KEY_PASS; if (c->flags & FLAG_SAVE_KEY_PASS) Button_SetCheck (GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_CHECKED); else { Button_SetCheck (GetDlgItem (hwndDlg, ID_CHK_SAVE_PASS), BST_UNCHECKED); DeleteSavedKeyPass(c->config_name); } break; case IDOK: if ((c->flags & FLAG_SAVE_KEY_PASS) && GetDlgItemTextW(hwndDlg, ID_EDT_PASSPHRASE, passphrase, _countof(passphrase)) && wcslen(passphrase) > 0) { SaveKeyPass(c->config_name, passphrase); SecureZeroMemory(passphrase, sizeof(passphrase)); } ManagementCommandFromInput(c, "password /"Private Key/" /"%s/"", hwndDlg, ID_EDT_PASSPHRASE); EndDialog(hwndDlg, LOWORD(wParam)); return TRUE; case IDCANCEL: EndDialog(hwndDlg, LOWORD(wParam)); StopOpenVPN (c); return TRUE; } break; case WM_CLOSE: EndDialog(hwndDlg, LOWORD(wParam)); return TRUE; case WM_NCDESTROY: RemoveProp(hwndDlg, cfgProp); break; } return FALSE;}
开发者ID:selvanair,项目名称:openvpn-gui,代码行数:76,
示例15: _afxWndUltimateLRESULT WINAPI _afxWndUltimate(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam){ WndUltimate*pWindow=(WndUltimate*)GetProp(hWnd,__UMyProp__); return(pWindow->_Main(uMsg,wParam,lParam));}
开发者ID:sukeyisme,项目名称:sukey_study,代码行数:5,
示例16: GetOptionIntBOOL CFileExplore::OnInitDialog() { CResizableDialog::OnInitDialog(); //m_CheckHeader.Create(IDB_TRAYSTATUS_BITMAP,16,0,0xFF00FF); //m_FileList.GetHeaderCtrl()->SetImageList(&m_CheckHeader); m_SortHeader.SubclassWindow(m_FileList.GetHeaderCtrl()->GetSafeHwnd()); m_iSortingMode = GetOptionInt(IDS_OFSMESSENGER,IDS_FILEL,1); m_hSplitter = AfxGetApp()->LoadCursor(IDC_SPLITH); ShowSizeGrip(FALSE); //m_FileList.SetExtendedStyle (m_FileList.GetExtendedStyle ()|LVS_EX_FULLROWSELECT); m_FileList.SetImageList(CImageList::FromHandle(GetSystemImageList(TRUE)),LVSIL_SMALL); CString strSection = GetString(IDS_OFSMESSENGER); CString strEntry = GetString(IDS_COLUMN_WIDTH); m_FileList.InsertColumn(0,GetString(IDS_FILENAME_NAME),LVCFMT_LEFT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("30"), 150)); m_FileList.InsertColumn(1,GetString(IDS_FILESIZE_NAME),LVCFMT_RIGHT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("33"), 80),3); m_FileList.InsertColumn(2,GetString(IDS_FILETYPE_NAME),LVCFMT_LEFT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("32"), 130),2); m_FileList.InsertColumn(3,GetString(IDS_FILEMODIFIED_NAME),LVCFMT_LEFT,AfxGetApp()->GetProfileInt(strSection, strEntry+_T("31"), 125),1); m_DirTree.SetImageList(CImageList::FromHandle(GetSystemImageList(TRUE)),TVSIL_NORMAL); //m_hRoot = CreateTreeItem(TVI_ROOT,GetString(IDS_MYDOCUMENTS)); //LoadTreeByPath(m_hRoot,m_strStartFolder); //m_DirTree.Expand(m_hRoot,TVE_EXPAND);/* CString strDefaultPath = GetDefaultPath(); CString strPathAddon = GetStartFolder(); while(!strDefaultPath.IsEmpty()) { int Pos = strDefaultPath.Find(_T('//')); if(Pos==-1) { strPathAddon += _T('//')+strDefaultPath; } else { strPathAddon += _T('//')+strDefaultPath.Left(Pos); strDefaultPath = strDefaultPath.Mid(Pos+1); } LoadTreeByPath(m_hRoot,m_strStartFolder); }*/ AddAnchor(&m_DirTree,CSize(0,0),CSize(0,100)); AddAnchor(&m_VSplitter,CSize(0,0),CSize(0,100)); AddAnchor(&m_FileList,CSize(0,0),CSize(100,100)); HANDLE hHanle1 = GetProp(m_FileList.GetSafeHwnd(),(LPCTSTR)(DWORD)0xC01C); m_OleFileListDropTarget.Register(&m_FileList); m_OleDirTreeDropTarget.Register(&m_DirTree); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE}
开发者ID:alex765022,项目名称:IBN,代码行数:62,
示例17: SubclassProcLRESULT CALLBACK SubclassProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, UINT_PTR uIdSubclass, DWORD_PTR dwRefData){ switch(uMsg) { case WM_NCDESTROY: { UINT uId = (UINT) GetProp(hWnd, gszSubclassProp); if(uId != 0) { RemoveProp(hWnd, gszSubclassProp); RemoveWindowSubclass(hWnd, SubclassProc, guIdSubclass); } } break; case WM_PARENTNOTIFY: if(LOWORD(wParam) == WM_CREATE) { bool bSubclass = true; // We stop at "Internet Explorer_Server TCHAR szClassName[MAX_PATH]; if ( GetClassName( hWnd, szClassName, ARRAYSIZE(szClassName) ) > 0 ) { if ( _tcscmp(szClassName, _T("Internet Explorer_Server")) == 0 ) { bSubclass = false; } } if(bSubclass) { HWND hWndChild = (HWND) lParam; UINT uId = (UINT) GetProp(hWndChild, gszSubclassProp); ATLASSERT(uId == 0); if(uId == 0) { AttachAll(hWndChild); } } } break; case WM_KEYDOWN: case WM_SYSKEYDOWN: { CWebBrowserCtrl* wb = WebBrowserFromHandle(hWnd); if(wb) { if( (uMsg == WM_KEYDOWN || uMsg == WM_SYSKEYDOWN) && ( HIBYTE(GetKeyState(VK_CONTROL)) || // Ctrl is pressed HIBYTE(GetKeyState(VK_MENU)) || // Alt is pressed ((wParam >= VK_F1) && (wParam <= VK_F24)) // Function-Keys is pressed ) ) { // Redirect to browser ::PostMessage( ::GetParent(::GetParent(::GetParent(::GetParent(wb->m_hWnd)))), uMsg, wParam, lParam ); } } } break; } return DefSubclassProc(hWnd, uMsg, wParam, lParam);}
开发者ID:Christiangutierrezperez,项目名称:ietabv2,代码行数:73,
示例18: PhpNetworkStackDlgProcstatic INT_PTR CALLBACK PhpNetworkStackDlgProc( _In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ){ switch (uMsg) { case WM_INITDIALOG: { PNETWORK_STACK_CONTEXT networkStackContext; HWND lvHandle; PPH_LAYOUT_MANAGER layoutManager; PVOID address; ULONG i; PhCenterWindow(hwndDlg, GetParent(hwndDlg)); networkStackContext = (PNETWORK_STACK_CONTEXT)lParam; SetProp(hwndDlg, PhMakeContextAtom(), (HANDLE)networkStackContext); lvHandle = GetDlgItem(hwndDlg, IDC_LIST); PhAddListViewColumn(lvHandle, 0, 0, 0, LVCFMT_LEFT, 350, L"Name"); PhSetListViewStyle(lvHandle, FALSE, TRUE); PhSetControlTheme(lvHandle, L"explorer"); networkStackContext->ListViewHandle = lvHandle; layoutManager = PhAllocate(sizeof(PH_LAYOUT_MANAGER)); PhInitializeLayoutManager(layoutManager, hwndDlg); SetProp(hwndDlg, L"LayoutManager", (HANDLE)layoutManager); PhAddLayoutItem(layoutManager, lvHandle, NULL, PH_ANCHOR_ALL); PhAddLayoutItem(layoutManager, GetDlgItem(hwndDlg, IDOK), NULL, PH_ANCHOR_RIGHT | PH_ANCHOR_BOTTOM); if (MinimumSize.left == -1) { RECT rect; rect.left = 0; rect.top = 0; rect.right = 190; rect.bottom = 120; MapDialogRect(hwndDlg, &rect); MinimumSize = rect; MinimumSize.left = 0; } for (i = 0; i < PH_NETWORK_OWNER_INFO_SIZE; i++) { PPH_STRING name; address = *(PVOID *)&networkStackContext->NetworkItem->OwnerInfo[i]; if ((ULONG_PTR)address < PAGE_SIZE) // stop at an invalid address break; name = PhGetSymbolFromAddress( networkStackContext->SymbolProvider, (ULONG64)address, NULL, NULL, NULL, NULL ); PhAddListViewItem(lvHandle, MAXINT, name->Buffer, NULL); PhDereferenceObject(name); } } break; case WM_DESTROY: { PPH_LAYOUT_MANAGER layoutManager; PNETWORK_STACK_CONTEXT networkStackContext; layoutManager = (PPH_LAYOUT_MANAGER)GetProp(hwndDlg, L"LayoutManager"); PhDeleteLayoutManager(layoutManager); PhFree(layoutManager); networkStackContext = (PNETWORK_STACK_CONTEXT)GetProp(hwndDlg, PhMakeContextAtom()); RemoveProp(hwndDlg, PhMakeContextAtom()); RemoveProp(hwndDlg, L"LayoutManager"); } break; case WM_COMMAND: { INT id = LOWORD(wParam); switch (id) { case IDCANCEL: // Esc and X button to close case IDOK: EndDialog(hwndDlg, IDOK); break; } }//.........这里部分代码省略.........
开发者ID:MaximeFrancoeur,项目名称:processhacker2,代码行数:101,
示例19: LinkLabelMsgProcLRESULT CALLBACK LinkLabelMsgProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ switch (message) { case WM_KILLFOCUS: ::RedrawWindow(hwnd, 0, 0, RDW_INVALIDATE); break; case WM_SETFOCUS: { RECT rc; HDC dc = ::GetDC(hwnd); ::GetClientRect(hwnd, &rc); ::DrawFocusRect(dc, &rc); ::ReleaseDC(hwnd, dc); } break; case WM_MOUSEMOVE: if (GetCapture() != hwnd) { SendMessage(hwnd, WM_SETFONT, (WPARAM)GetProp(hwnd, TEXT("Underline")), TRUE); SetCapture(hwnd); } else { RECT rc; GetWindowRect(hwnd, &rc); POINT p = { LOWORD(lParam), HIWORD(lParam) }; ClientToScreen(hwnd, &p); if (!PtInRect(&rc, p)) ReleaseCapture(); } break; case WM_CAPTURECHANGED: SendMessage(hwnd, WM_SETFONT, (WPARAM)GetProp(hwnd, TEXT("BaseFont")), TRUE); break; case WM_SETCURSOR: { HCURSOR hand = (HCURSOR)LoadImage(0, IDC_HAND, IMAGE_CURSOR, 0, 0, LR_SHARED); if (hand) SetCursor(hand); return TRUE; } break; case WM_KEYUP: if (wParam != VK_SPACE) break; case WM_LBUTTONUP: { WCHAR *wc = (WCHAR*)GetProp(hwnd, TEXT("Link")); if ( wc ) ShellExecute(0, 0, wc, 0, 0, SW_SHOWNORMAL); } break; case WM_DESTROY: { WCHAR *wc = (WCHAR*)GetProp(hwnd, TEXT("Link")); if (wc) delete [] wc; RemoveProp(hwnd, TEXT("Link")); RemoveProp(hwnd, TEXT("BaseFont")); HFONT underline = (HFONT)GetProp(hwnd, TEXT("Underline")); ::DeleteObject(underline); RemoveProp(hwnd, TEXT("Underline")); } break; } WNDPROC base = (WNDPROC)GetProp( hwnd, TEXT("BaseWndProc")); return CallWindowProc(base, hwnd, message, wParam, lParam);}
开发者ID:charlesberthillon,项目名称:Basic-Excel-R-Toolkit,代码行数:72,
示例20: _HyperlinkProcLRESULT CALLBACK _HyperlinkProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ WNDPROC pfnOrigProc = (WNDPROC) GetProp(hwnd, PROP_ORIGINAL_PROC); switch (message) { case WM_DESTROY: { SetWindowLong(hwnd, GWL_WNDPROC, (LONG) pfnOrigProc); RemoveProp(hwnd, PROP_ORIGINAL_PROC); HFONT hOrigFont = (HFONT) GetProp(hwnd, PROP_ORIGINAL_FONT); SendMessage(hwnd, WM_SETFONT, (WPARAM) hOrigFont, 0); RemoveProp(hwnd, PROP_ORIGINAL_FONT); HFONT hFont = (HFONT) GetProp(hwnd, PROP_UNDERLINE_FONT); DeleteObject(hFont); RemoveProp(hwnd, PROP_UNDERLINE_FONT); RemoveProp(hwnd, PROP_STATIC_HYPERLINK); break; } case WM_MOUSEMOVE: { if (GetCapture() != hwnd) { HFONT hFont = (HFONT) GetProp(hwnd, PROP_UNDERLINE_FONT); SendMessage(hwnd, WM_SETFONT, (WPARAM) hFont, FALSE); InvalidateRect(hwnd, NULL, FALSE); SetCapture(hwnd); } else { RECT rect; GetWindowRect(hwnd, &rect); POINT pt = { LOWORD(lParam), HIWORD(lParam) }; ClientToScreen(hwnd, &pt); if (!PtInRect(&rect, pt)) { HFONT hFont = (HFONT) GetProp(hwnd, PROP_ORIGINAL_FONT); SendMessage(hwnd, WM_SETFONT, (WPARAM) hFont, FALSE); InvalidateRect(hwnd, NULL, FALSE); ReleaseCapture(); } } break; } case WM_SETCURSOR: { // Since IDC_HAND is not available on all operating systems, // we will load the arrow cursor if IDC_HAND is not present. HCURSOR hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_HAND)); if (NULL == hCursor) { hCursor = LoadCursor(NULL, MAKEINTRESOURCE(IDC_ARROW)); } SetCursor(hCursor); return TRUE; } } return CallWindowProc(pfnOrigProc, hwnd, message, wParam, lParam);}
开发者ID:ACanadianKernel,项目名称:pcsx2,代码行数:66,
示例21: listDirectoryToPanelWorker//.........这里部分代码省略......... } lvI.lParam = NULL; ++ lvI.iItem; } } lvI.mask = LVIF_TEXT | LVIF_IMAGE; lvI.iItem = 0; lvI.lParam = 0; SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_DELETEALLITEMS, 0, 0); hIL = (HIMAGELIST) SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_GETIMAGELIST, (WPARAM)LVSIL_SMALL, 0); if (hIL == NULL) { hIL = ImageList_Create (16, 16, ILC_COLORDDB, 255, 1); SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_SETIMAGELIST, LVSIL_SMALL, (LPARAM) hIL); } else { ImageList_RemoveAll (hIL); } WIN32_FIND_DATA findData = {0}; wsprintf (str, L"%s%s", ltpd->path, L"//*"); HANDLE hFFile = FindFirstFile (str, &findData); if (hFFile != INVALID_HANDLE_VALUE) { isUpDirPresent = findData.cFileName[0] == L'.'; isUpDirPresent &= findData.cFileName[1] == L'.'; isUpDirPresent &= findData.cFileName[2] == L'/0'; if (FM_AFTLV_OK == addFileToListView (ltpd->hDlg, &findData, ltpd->itemId, &lvI)) { setFileIcon (ltpd->hDlg, ltpd->path, &findData, &lvI, hIL); lvI.mask = LVIF_IMAGE; SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_SETITEM, 0, (LPARAM)&lvI); // Перейти к следующей строке ++ lvI.iItem; } while (FindNextFile (hFFile, &findData)) { if (!isUpDirPresent) { if (lstrcmp (findData.cFileName, L"..") == 0) { isUpDirPresent = TRUE; } } if (FM_AFTLV_OK == addFileToListView (ltpd->hDlg, &findData, ltpd->itemId, &lvI)) { setFileIcon (ltpd->hDlg, ltpd->path, &findData, &lvI, hIL); lvI.mask = LVIF_IMAGE; SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_SETITEM, 0, (LPARAM)&lvI); ++ lvI.iItem; } } FindClose (hFFile); } else // Возникла ошибка { // Показать List View wprintfd (L"Возникла ошибка при FindFirstFile('%s', ...)", str); SendMessage (ltpd->hDlg, FM_LIST_FINISHED, ltpd->itemId, (LPARAM)ltpd); return 1; } // Символ L".." не был найден, значит его надо вставить if (!isUpDirPresent) { // Имя файла L".." и соответствующая иконка HINSTANCE hInst = (HINSTANCE) GetWindowLong (ltpd->hDlg, GWL_HINSTANCE); HICON hIcon = LoadIcon (hInst, MAKEINTRESOURCE (IDI_ICON1)); lvI.iItem = 0; // L".." всегда в первой строке lvI.iImage = ImageList_ReplaceIcon (hIL, lvI.iItem, hIcon); lvI.iSubItem = FM_COLUMN_NAME; // Колонка названия файлов lvI.pszText = L".."; lvI.lParam = NULL; SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_INSERTITEM, (WPARAM)0, (LPARAM)&lvI); DestroyIcon (hIcon); } // Сортировать панель FmPanelProps* props = (FmPanelProps*)GetProp (GetDlgItem(ltpd->hDlg, ltpd->itemId), L"Props"); NMLISTVIEW nmlv = {0}; nmlv.iSubItem = props->sortColumnIndex; lvI.mask = LVIF_IMAGE; DWORD cnt = SendDlgItemMessage(ltpd->hDlg, ltpd->itemId, LVM_GETITEMCOUNT, 0, 0); for (lvI.iItem = 0; lvI.iItem < cnt; ++ lvI.iItem) { SendDlgItemMessage (ltpd->hDlg, ltpd->itemId, LVM_GETITEM,0, (LPARAM) &lvI); wprintfd(L"item:%u image:%u", lvI.iItem, lvI.iImage); } SendMessage (ltpd->hDlg, FM_LIST_FINISHED, ltpd->itemId, (LPARAM)ltpd); return 0;}
开发者ID:shasa2013,项目名称:fileman,代码行数:101,
示例22: PhpThreadStackDlgProcstatic INT_PTR CALLBACK PhpThreadStackDlgProc( _In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ){ switch (uMsg) { case WM_INITDIALOG: { NTSTATUS status; PTHREAD_STACK_CONTEXT threadStackContext; PPH_STRING title; HWND lvHandle; PPH_LAYOUT_MANAGER layoutManager; threadStackContext = (PTHREAD_STACK_CONTEXT)lParam; SetProp(hwndDlg, PhMakeContextAtom(), (HANDLE)threadStackContext); title = PhFormatString(L"Stack - thread %u", (ULONG)threadStackContext->ThreadId); SetWindowText(hwndDlg, title->Buffer); PhDereferenceObject(title); lvHandle = GetDlgItem(hwndDlg, IDC_LIST); PhAddListViewColumn(lvHandle, 0, 0, 0, LVCFMT_LEFT, 30, L" "); PhAddListViewColumn(lvHandle, 1, 1, 1, LVCFMT_LEFT, 300, L"Name"); PhSetListViewStyle(lvHandle, FALSE, TRUE); PhSetControlTheme(lvHandle, L"explorer"); PhLoadListViewColumnsFromSetting(L"ThreadStackListViewColumns", lvHandle); threadStackContext->ListViewHandle = lvHandle; layoutManager = PhAllocate(sizeof(PH_LAYOUT_MANAGER)); PhInitializeLayoutManager(layoutManager, hwndDlg); SetProp(hwndDlg, L"LayoutManager", (HANDLE)layoutManager); PhAddLayoutItem(layoutManager, lvHandle, NULL, PH_ANCHOR_ALL); PhAddLayoutItem(layoutManager, GetDlgItem(hwndDlg, IDC_COPY), NULL, PH_ANCHOR_RIGHT | PH_ANCHOR_BOTTOM); PhAddLayoutItem(layoutManager, GetDlgItem(hwndDlg, IDC_REFRESH), NULL, PH_ANCHOR_RIGHT | PH_ANCHOR_BOTTOM); PhAddLayoutItem(layoutManager, GetDlgItem(hwndDlg, IDOK), NULL, PH_ANCHOR_RIGHT | PH_ANCHOR_BOTTOM); if (MinimumSize.left == -1) { RECT rect; rect.left = 0; rect.top = 0; rect.right = 190; rect.bottom = 120; MapDialogRect(hwndDlg, &rect); MinimumSize = rect; MinimumSize.left = 0; } PhLoadWindowPlacementFromSetting(NULL, L"ThreadStackWindowSize", hwndDlg); PhCenterWindow(hwndDlg, GetParent(hwndDlg)); if (PhPluginsEnabled) { PH_PLUGIN_THREAD_STACK_CONTROL control; control.Type = PluginThreadStackInitializing; control.UniqueKey = threadStackContext; control.u.Initializing.ProcessId = threadStackContext->ProcessId; control.u.Initializing.ThreadId = threadStackContext->ThreadId; control.u.Initializing.ThreadHandle = threadStackContext->ThreadHandle; control.u.Initializing.SymbolProvider = threadStackContext->SymbolProvider; control.u.Initializing.CustomWalk = FALSE; PhInvokeCallback(PhGetGeneralCallback(GeneralCallbackThreadStackControl), &control); threadStackContext->CustomWalk = control.u.Initializing.CustomWalk; } status = PhpRefreshThreadStack(hwndDlg, threadStackContext); if (status == STATUS_ABANDONED) EndDialog(hwndDlg, IDCANCEL); else if (!NT_SUCCESS(status)) PhShowStatus(hwndDlg, L"Unable to load the stack", status, 0); } break; case WM_DESTROY: { PPH_LAYOUT_MANAGER layoutManager; PTHREAD_STACK_CONTEXT threadStackContext; ULONG i; layoutManager = (PPH_LAYOUT_MANAGER)GetProp(hwndDlg, L"LayoutManager"); PhDeleteLayoutManager(layoutManager); PhFree(layoutManager); threadStackContext = (PTHREAD_STACK_CONTEXT)GetProp(hwndDlg, PhMakeContextAtom()); if (PhPluginsEnabled) {//.........这里部分代码省略.........
开发者ID:JamesLinus,项目名称:processhacker_2.33,代码行数:101,
示例23: PhpThreadStackProgressDlgProcstatic INT_PTR CALLBACK PhpThreadStackProgressDlgProc( _In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ){ switch (uMsg) { case WM_INITDIALOG: { PTHREAD_STACK_CONTEXT threadStackContext; HANDLE threadHandle; threadStackContext = (PTHREAD_STACK_CONTEXT)lParam; SetProp(hwndDlg, PhMakeContextAtom(), (HANDLE)threadStackContext); threadStackContext->ProgressWindowHandle = hwndDlg; if (threadHandle = PhCreateThread(0, PhpRefreshThreadStackThreadStart, threadStackContext)) { NtClose(threadHandle); } else { threadStackContext->WalkStatus = STATUS_UNSUCCESSFUL; EndDialog(hwndDlg, IDOK); break; } PhCenterWindow(hwndDlg, GetParent(hwndDlg)); PhSetWindowStyle(GetDlgItem(hwndDlg, IDC_PROGRESS), PBS_MARQUEE, PBS_MARQUEE); SendMessage(GetDlgItem(hwndDlg, IDC_PROGRESS), PBM_SETMARQUEE, TRUE, 75); SetWindowText(hwndDlg, L"Loading stack..."); } break; case WM_DESTROY: { RemoveProp(hwndDlg, PhMakeContextAtom()); } break; case WM_COMMAND: { switch (LOWORD(wParam)) { case IDCANCEL: { PTHREAD_STACK_CONTEXT threadStackContext = (PTHREAD_STACK_CONTEXT)GetProp(hwndDlg, PhMakeContextAtom()); EnableWindow(GetDlgItem(hwndDlg, IDCANCEL), FALSE); threadStackContext->StopWalk = TRUE; } break; } } break; case WM_PH_COMPLETED: { EndDialog(hwndDlg, IDOK); } break; case WM_PH_STATUS_UPDATE: { PTHREAD_STACK_CONTEXT threadStackContext = (PTHREAD_STACK_CONTEXT)GetProp(hwndDlg, PhMakeContextAtom()); PPH_STRING message; PhAcquireQueuedLockExclusive(&threadStackContext->StatusLock); message = threadStackContext->StatusMessage; PhReferenceObject(message); PhReleaseQueuedLockExclusive(&threadStackContext->StatusLock); SetDlgItemText(hwndDlg, IDC_PROGRESSTEXT, message->Buffer); PhDereferenceObject(message); } break; } return 0;}
开发者ID:JamesLinus,项目名称:processhacker_2.33,代码行数:79,
示例24: HelpWindowProcLRESULT CALLBACK HelpWindowProc ( HWND hwnd, uint message, WPARAM wparam, LPARAM lparam ) { register THelp :: THotkeyType Type ; WNDPROC WindowProc ; HANDLE WndProcProperty ; if ( ! THelp :: TheHelpObject || ! THelp :: TheHelpObject -> HelpTableCount ) throw xmsg ( string ( "HelpWindowProc a été appelée alors qu'il n'y a aucune aide disponible !!!" ) ) ; switch ( message ) { // Messages qui sont peut-être des hotkeys case WM_KEYDOWN : case WM_CHAR : Type = THelp :: TheHelpObject -> IsHotkey ( hwnd, message, wparam, lparam ) ; if ( Type != THelp :: Unknown ) { THelp :: TheHelpObject -> ProcessHelpRequest ( THelp :: WindowHelp, Type, hwnd, message, wparam, lparam ) ; return ( 0L ) ; } break ; // C'est au MENUSELECT qu'on peut récupérer des infos sur l'élément de // menu actuellement sélectionné. // Lorsque LOWORD ( lparam ) == 0xFFFF et HIWORD ( lparam ) est à zéro, // on est sur un menu popup dont le handle est donné par wparam case WM_MENUSELECT : if ( LOWORD ( lparam ) != 0xFFFF && HIWORD ( lparam ) ) { THelp :: TheHelpObject -> LastSelectedMenuType = LOWORD ( lparam ) ; if ( LOWORD ( lparam ) & MF_POPUP ) { THelp :: TheHelpObject -> LastSelectedMenu = 0 ; THelp :: TheHelpObject -> LastSelectedMenuHandle = ( HMENU ) wparam ; } else { THelp :: TheHelpObject -> LastSelectedMenu = wparam ; THelp :: TheHelpObject -> LastSelectedMenuHandle = ( HMENU ) HIWORD ( lparam ) ; } } break ; }// Il s'agit maintenant d'appeler la bonne WindowProc. On récupère l'index de la// première référence à cette fenêtre WndProcProperty = GetProp ( hwnd, WNDPROC_PROPERTY ) ; WindowProc = NULL ; if ( WndProcProperty ) WindowProc = THelp :: TheHelpObject -> HelpTable [ ( int ) WndProcProperty - 1 ]. WindowProc ; if ( WindowProc != NULL ) return ( CallWindowProc ( WindowProc, hwnd, message, wparam, lparam ) ) ; else return ( 0L ) ; }
开发者ID:wuthering-bytes,项目名称:cheops,代码行数:73,
示例25: KappaRBGroupProcLRESULT W_CALLBACK KappaRBGroupProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam){ ATOMID idWidget; static HBRUSH hBrBack; HWND hRBWnd; short i; HDC hDCx; switch (msg) { case WM_SETFOCUS: for (i = 1; i < 1000; ++i) { if ((hRBWnd = GetDlgItem(hWnd, i)) != NULL) { if (IsDlgButtonChecked(hWnd, i)) { SetFocus(hRBWnd); break; } } else { /* if no button is checked, focus on the first one */ hRBWnd = GetDlgItem(hWnd, 1); SetFocus(hRBWnd); break; } } break; case WM_SIZE: if (wParam == SIZENORMAL) { idWidget = KpsGetWidgetFromWindow(hWnd); KpsSizeWidget(hWnd, LOWORD(lParam), HIWORD(lParam)); AdjustCBGroup(hWnd, idWidget); } break; case IDG_RESET: DisplayRBGroup(hWnd); return TRUE; case WM_DESTROY: if (hBrBack) { DeleteObject(hBrBack); hBrBack = NULL; } break; case WM_PAINT: idWidget = KpsGetWidgetFromWindow(hWnd); hDCx = GetProp(hWnd, (LPSTR) "Context"); /* If no children, return FALSE to allow drawing of the BITMAP. Otherwise, return TRUE for no bitmap */ if (!GetWindow(hWnd, GW_CHILD)) return (long) FALSE; else KpiDisplayTitle(hWnd, hDCx, idWidget); return (long) TRUE; case WM_COMMAND: switch (wParam) { case IDG_CLICKED: UpdateRBGroupValue(hWnd, LOWORD(lParam)); break; default: break; } default: break; } return DefWindowProc(hWnd, msg, wParam, lParam);}
开发者ID:thearttrooper,项目名称:KappaPC,代码行数:81,
示例26: switchLRESULT DcxDivider::PostMessage( UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL & bParsed ) { LRESULT lRes = 0L; switch( uMsg ) { case WM_NOTIFY : { LPNMHDR hdr = (LPNMHDR) lParam; if (!hdr) break; if (IsWindow(hdr->hwndFrom)) { DcxControl *c_this = (DcxControl *) GetProp(hdr->hwndFrom,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_HSCROLL: case WM_VSCROLL: case WM_COMMAND: { if (IsWindow((HWND) lParam)) { DcxControl *c_this = (DcxControl *) GetProp((HWND) lParam,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_COMPAREITEM: { LPCOMPAREITEMSTRUCT idata = (LPCOMPAREITEMSTRUCT)lParam; if ((idata != NULL) && (IsWindow(idata->hwndItem))) { DcxControl *c_this = (DcxControl *) GetProp(idata->hwndItem,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_DELETEITEM: { DELETEITEMSTRUCT *idata = (DELETEITEMSTRUCT *)lParam; if ((idata != NULL) && (IsWindow(idata->hwndItem))) { DcxControl *c_this = (DcxControl *) GetProp(idata->hwndItem,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_MEASUREITEM: { HWND cHwnd = GetDlgItem(this->m_Hwnd, wParam); if (IsWindow(cHwnd)) { DcxControl *c_this = (DcxControl *) GetProp(cHwnd,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_DRAWITEM: { DRAWITEMSTRUCT *idata = (DRAWITEMSTRUCT *)lParam; if ((idata != NULL) && (IsWindow(idata->hwndItem))) { DcxControl *c_this = (DcxControl *) GetProp(idata->hwndItem,"dcx_cthis"); if (c_this != NULL) lRes = c_this->ParentMessage(uMsg, wParam, lParam, bParsed); } } break; case WM_DESTROY: { delete this; bParsed = TRUE; } break; case DV_CHANGEPOS: { const int phase = (int) wParam; const LPPOINT pt = (LPPOINT) lParam; this->execAliasEx("%s,%d,%d,%d", (phase == DVNM_DRAG_START ? "dragbegin" : (phase == DVNM_DRAG_END ? "dragfinish" : "drag")), this->getUserID(), pt->x, pt->y); } break; default: lRes = this->CommonMessage( uMsg, wParam, lParam, bParsed); break; } return lRes;}
开发者ID:dlsocool,项目名称:dcx,代码行数:98,
示例27: PhpRunAsDlgProcINT_PTR CALLBACK PhpRunAsDlgProc( _In_ HWND hwndDlg, _In_ UINT uMsg, _In_ WPARAM wParam, _In_ LPARAM lParam ){ PRUNAS_DIALOG_CONTEXT context; if (uMsg != WM_INITDIALOG) { context = (PRUNAS_DIALOG_CONTEXT)GetProp(hwndDlg, PhMakeContextAtom()); } else { context = (PRUNAS_DIALOG_CONTEXT)lParam; SetProp(hwndDlg, PhMakeContextAtom(), (HANDLE)context); } if (!context) return FALSE; switch (uMsg) { case WM_INITDIALOG: { HWND typeComboBoxHandle = GetDlgItem(hwndDlg, IDC_TYPE); HWND userNameComboBoxHandle = GetDlgItem(hwndDlg, IDC_USERNAME); ULONG sessionId; PhCenterWindow(hwndDlg, GetParent(hwndDlg)); if (SHAutoComplete_I) { SHAutoComplete_I( GetDlgItem(hwndDlg, IDC_PROGRAM), SHACF_AUTOAPPEND_FORCE_ON | SHACF_AUTOSUGGEST_FORCE_ON | SHACF_FILESYS_ONLY ); } ComboBox_AddString(typeComboBoxHandle, L"Batch"); ComboBox_AddString(typeComboBoxHandle, L"Interactive"); ComboBox_AddString(typeComboBoxHandle, L"Network"); ComboBox_AddString(typeComboBoxHandle, L"New credentials"); ComboBox_AddString(typeComboBoxHandle, L"Service"); PhSelectComboBoxString(typeComboBoxHandle, L"Interactive", FALSE); ComboBox_AddString(userNameComboBoxHandle, L"NT AUTHORITY//SYSTEM"); ComboBox_AddString(userNameComboBoxHandle, L"NT AUTHORITY//LOCAL SERVICE"); ComboBox_AddString(userNameComboBoxHandle, L"NT AUTHORITY//NETWORK SERVICE"); PhpAddAccountsToComboBox(userNameComboBoxHandle); if (NT_SUCCESS(PhGetProcessSessionId(NtCurrentProcess(), &sessionId))) SetDlgItemInt(hwndDlg, IDC_SESSIONID, sessionId, FALSE); SetDlgItemText(hwndDlg, IDC_DESKTOP, L"WinSta0//Default"); SetDlgItemText(hwndDlg, IDC_PROGRAM, PhaGetStringSetting(L"RunAsProgram")->Buffer); if (!context->ProcessId) { SetDlgItemText(hwndDlg, IDC_USERNAME, PH_AUTO_T(PH_STRING, PhGetStringSetting(L"RunAsUserName"))->Buffer); // Fire the user name changed event so we can fix the logon type. SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_USERNAME, CBN_EDITCHANGE), 0); } else { HANDLE processHandle; HANDLE tokenHandle; PTOKEN_USER user; PPH_STRING userName; if (NT_SUCCESS(PhOpenProcess( &processHandle, ProcessQueryAccess, context->ProcessId ))) { if (NT_SUCCESS(PhOpenProcessToken( processHandle, TOKEN_QUERY, &tokenHandle ))) { if (NT_SUCCESS(PhGetTokenUser(tokenHandle, &user))) { if (userName = PhGetSidFullName(user->User.Sid, TRUE, NULL)) { SetDlgItemText(hwndDlg, IDC_USERNAME, userName->Buffer); PhDereferenceObject(userName); } PhFree(user); } NtClose(tokenHandle); }//.........这里部分代码省略.........
开发者ID:ohio813,项目名称:processhacker2,代码行数:101,
示例28: winWindowProcLRESULT CALLBACKwinWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam){ static winPrivScreenPtr s_pScreenPriv = NULL; static winScreenInfo *s_pScreenInfo = NULL; static ScreenPtr s_pScreen = NULL; static HWND s_hwndLastPrivates = NULL; static HINSTANCE s_hInstance; static Bool s_fTracking = FALSE; static unsigned long s_ulServerGeneration = 0; static UINT s_uTaskbarRestart = 0; int iScanCode; int i;#if CYGDEBUG winDebugWin32Message("winWindowProc", hwnd, message, wParam, lParam);#endif /* Watch for server regeneration */ if (g_ulServerGeneration != s_ulServerGeneration) { /* Store new server generation */ s_ulServerGeneration = g_ulServerGeneration; } /* Only retrieve new privates pointers if window handle is null or changed */ if ((s_pScreenPriv == NULL || hwnd != s_hwndLastPrivates) && (s_pScreenPriv = GetProp(hwnd, WIN_SCR_PROP)) != NULL) {#if CYGDEBUG winDebug("winWindowProc - Setting privates handle/n");#endif s_pScreenInfo = s_pScreenPriv->pScreenInfo; s_pScreen = s_pScreenInfo->pScreen; s_hwndLastPrivates = hwnd; } else if (s_pScreenPriv == NULL) { /* For safety, handle case that should never happen */ s_pScreenInfo = NULL; s_pScreen = NULL; s_hwndLastPrivates = NULL; } /* Branch on message type */ switch (message) { case WM_TRAYICON: return winHandleIconMessage(hwnd, message, wParam, lParam, s_pScreenPriv); case WM_CREATE:#if CYGDEBUG winDebug("winWindowProc - WM_CREATE/n");#endif /* * Add a property to our display window that references * this screens' privates. * * This allows the window procedure to refer to the * appropriate window DC and shadow DC for the window that * it is processing. We use this to repaint exposed * areas of our display window. */ s_pScreenPriv = ((LPCREATESTRUCT) lParam)->lpCreateParams; s_hInstance = ((LPCREATESTRUCT) lParam)->hInstance; s_pScreenInfo = s_pScreenPriv->pScreenInfo; s_pScreen = s_pScreenInfo->pScreen; s_hwndLastPrivates = hwnd; s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated")); SetProp(hwnd, WIN_SCR_PROP, s_pScreenPriv); /* Setup tray icon */ if (!s_pScreenInfo->fNoTrayIcon) { /* * NOTE: The WM_CREATE message is processed before CreateWindowEx * returns, so s_pScreenPriv->hwndScreen is invalid at this point. * We go ahead and copy our hwnd parameter over top of the screen * privates hwndScreen so that we have a valid value for * that member. Otherwise, the tray icon will disappear * the first time you move the mouse over top of it. */ s_pScreenPriv->hwndScreen = hwnd; winInitNotifyIcon(s_pScreenPriv); } return 0; case WM_DISPLAYCHANGE: /* WM_DISPLAYCHANGE seems to be sent when the monitor layout or any monitor's resolution or depth changes, but it's lParam and wParam always indicate the resolution and bpp for the primary monitor (so ignore that as we could be on any monitor...) */ /* We cannot handle a display mode change during initialization */ if (s_pScreenInfo == NULL) FatalError("winWindowProc - WM_DISPLAYCHANGE - The display " "mode changed while we were intializing. This is " "very bad and unexpected. Exiting./n");//.........这里部分代码省略.........
开发者ID:LeadHyperion,项目名称:RaspberryPiXServer,代码行数:101,
注:本文中的GetProp函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GetPropW函数代码示例 C++ GetProfileString函数代码示例 |