SetProp

http://www.vckbase.com/index.php/wv/473

	
CString g_szPropName = "Your Prop Name";
HANDLE	g_hValue = (HANDLE)1;

//设置窗口属性
SetProp(m_hWnd,g_szPropName,g_hValue);

HANDLE h = GetProp(hwnd,g_szPropName);
if( h == g_hValue)
{
	*(HWND*)lParam = hwnd;
	return false;
}

 

LONG_PTR SetWindowLongPtr(      

HWND hWnd, int nIndex, LONG_PTR dwNewLong );

Parameters

hWnd
[in] Handle to the window and, indirectly, the class to which the window belongs. The SetWindowLongPtr function fails if the window specified by the hWndparameter does not belong to the same process as the calling thread.
nIndex
[in] Specifies the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To set any other value, specify one of the following values.
GWL_EXSTYLE
Sets a new extended window style. For more information, seeCreateWindowEx.
GWL_STYLE
Sets a newwindow style.
GWLP_WNDPROC
Sets a new address for the window procedure.
GWLP_HINSTANCE
Sets a new application instance handle.
GWLP_ID
Sets a new identifier of the window.
GWLP_USERDATA
Sets the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.
The following values are also available when the hWndparameter identifies a dialog box.
DWLP_DLGPROC
Sets the new pointer to the dialog box procedure.
DWLP_MSGRESULT
Sets the return value of a message processed in the dialog box procedure.
DWLP_USER
Sets new extra information that is private to the application, such as handles or pointers.
dwNewLong
[in] Specifies the replacement value.

Return Value

If the function succeeds, the return value is the previous value of the specified offset.

If the function fails, the return value is zero. To get extended error information, callGetLastError.

If the previous value is zero and the function succeeds, the return value is zero, but the function does not clear the last error information. To determine success or failure, clear the last error information by calling SetLastError(0), then call SetWindowLongPtr. Function failure will be indicated by a return value of zero and a GetLastError result that is nonzero.

 

LONG_PTR GetWindowLongPtr(     

    HWND hWnd,
    int nIndex
);

 

hWnd
[in]

Handle to the window and, indirectly, the class to which the window belongs.

If you are retrieving a pointer or a handle, this function supersedes the GetWindowLong function. (Pointers and handles are 32 bits on 32-bit Windows and 64 bits on 64-bit Windows.) To write code that is compatible with both 32-bit and 64-bit versions of Windows, use GetWindowLongPtr.

nIndex
[in] Specifies the zero-based offset to the value to be retrieved. Valid values are in the range zero through the number of bytes of extra window memory, minus the size of an integer. To retrieve any other value, specify one of the following values.
GWL_EXSTYLE
Retrieves the extended window styles. For more information, seeCreateWindowEx.
GWL_STYLE
Retrieves thewindow styles.
GWLP_WNDPROC
Retrieves the pointer to the window procedure, or a handle representing the pointer to the window procedure. You must use theCallWindowProcfunction to call the window procedure.
GWLP_HINSTANCE
Retrieves a handle to the application instance.
GWLP_HWNDPARENT
Retrieves a handle to the parent window, if there is one.
GWLP_ID
Retrieves the identifier of the window.
GWLP_USERDATA
Retrieves the user data associated with the window. This data is intended for use by the application that created the window. Its value is initially zero.
The following values are also available when the hWndparameter identifies a dialog box.
DWLP_DLGPROC
Retrieves the pointer to the dialog box procedure, or a handle representing the pointer to the dialog box procedure. You must use the CallWindowProcfunction to call the dialog box procedure.
DWLP_MSGRESULT
Retrieves the return value of a message processed in the dialog box procedure.
DWLP_USER
Retrieves extra information private to the application, such as handles or pointers.

Return Value

If the function succeeds, the return value is the requested value.

If the function fails, the return value is zero. To get extended error information, callGetLastError.

If SetWindowLongor SetWindowLongPtrhas not been called previously, GetWindowLongPtr returns zero for values in the extra window or class memory.

转载于:https://www.cnblogs.com/chunyou128/archive/2012/08/24/2653494.html

on post-fs # LMK setprop ro.lmk.pgscan_limit 3000 setprop ro.lmk.swap_util_max 90 setprop ro.lmk.threshold_decay 60 setprop ro.lmk.filecache_min_kb 300000 # LMK 3.1 setprop ro.lmk.psi_complete_stall_ms 500 setprop ro.lmk.psi_partial_stall_ms 70 setprop ro.lmk.file_high_percentage 75 setprop ro.lmk.file_low_percentage 40 setprop ro.lmk.swap_free_low_percentage 10 setprop ro.lmk.kill_timeout_ms 150 setprop ro.lmk.stall_limit_medium 2 setprop ro.lmk.stall_limit_critical 4 setprop ro.lmk.stall_limit_freeze 15 setprop ro.lmk.medium_min_adj 900 setprop ro.lmk.critical_min_adj 201 setprop ro.lmk.freeze_min_adj 50 setprop ro.lmk.kswapd_limit 90 setprop ro.lmk.kswapd_limit_decay 10 setprop ro.lmk.kswapd_min_adj 201 setprop ro.lmk.thrashing_limit 80 setprop ro.lmk.thrashing_limit_critical 80 setprop ro.lmk.thrashing_limit_decay 25 setprop ro.lmk.min_thrashing_limit 20 # delay longer for service restart, will be rescheduled immediately once mempressure backing to normal. setprop ro.config.svc_restart_delay_on_moderate_mem 60000 setprop ro.config.svc_restart_delay_on_low_mem 3600000 setprop ro.config.svc_restart_delay_on_critical_mem 3600000 setprop ro.lmk.always_bg_cpuset_threads kcompactd0 setprop ro.lmk.always_hbg_cpuset_threads kswapd0 # App compactor setprop ro.config.use_compaction true setprop ro.config.compact_bootcompleted true setprop ro.config.compact_action_1 4 setprop ro.config.compact_action_2 2 setprop ro.config.compact_procstate_throttle 11,18 # LowMemoryDetector of Framework setprop ro.lowmemdetector.psi_low_stall_us 100000 setprop ro.lowmemdetector.psi_medium_stall_us 150000 setprop ro.lowmemdetector.psi_high_stall_us 200000 逐条分析上述代码,优化配置,使系统能够流畅运行兼顾后台保活
最新发布
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值