本文整理汇总了C++中GetProp函数的典型用法代码示例。如果您正苦于以下问题:C++ GetProp函数的具体用法?C++ GetProp怎么用?C++ GetProp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetProp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UserAuthDialogFunc
/*
* DialogProc for OpenVPN username/password/challenge auth dialog windows
*/
INT_PTR CALLBACK
UserAuthDialogFunc(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;
//.........这里部分代码省略.........
示例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;
//.........这里部分代码省略.........
示例3: HookHandle
inline 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
//.........这里部分代码省略.........
示例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);
}
示例5: winMWExtWMWindowProc
LRESULT CALLBACK
winMWExtWMWindowProc (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;
//.........这里部分代码省略.........
示例6: winWindowProc
LRESULT CALLBACK
winWindowProc (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.
//.........这里部分代码省略.........
示例7: _docsumparams
Config::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);
}
示例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))
{
//.........这里部分代码省略.........
示例9: SetProp
INT_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();
//.........这里部分代码省略.........
示例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;
*/
//.........这里部分代码省略.........
示例11: NetworkOutputDlgProc
static 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,
//.........这里部分代码省略.........
示例12: GetControlPtr
LONG GetControlPtr(HWND hWnd)
{
long rVal = MAKELONG((UINT)GetProp(hWnd, LOPTR), (UINT)GetProp(hWnd, HIPTR));
return rVal;
}
示例13: StatusDialogFunc
/*
* DialogProc for OpenVPN status dialog windows
*/
INT_PTR CALLBACK
StatusDialogFunc(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;
//.........这里部分代码省略.........
示例14: PrivKeyPassDialogFunc
/*
* DialogProc for OpenVPN private key password dialog windows
*/
INT_PTR CALLBACK
PrivKeyPassDialogFunc(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;
}
示例15: _afxWndUltimate
LRESULT WINAPI _afxWndUltimate(HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
WndUltimate*pWindow=(WndUltimate*)GetProp(hWnd,__UMyProp__);
return(pWindow->_Main(uMsg,wParam,lParam));
}