📄 ntutils.h
字号:
/*
ntutils-library
- provides several functions for easy access winNT interna
- needs psapi.lib
*/
#ifndef _NTUTILS_H_
#define _NTUTILS_H_
#include <windows.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* ntutils_pid2nam
*
* PURPOSE: retreives the name of a specified process
*
* PARAMS: pid ... process id of process
* name ... name returned (without extension)
* len ... length of provided name-buffer
*
* RETURNS: 0 ... success, -1 otherwise
*/
extern int ntutils_pid2nam(int pid, char* name, int len);
/*
* ntutils_nam2pid
*
* PURPOSE: retreives the PID of a process whose executable-name is specified
*
* PARAMS: name ... name of executable (with or without extension)
*
* RETURNS: >=0 ... PID of searched process or 0 if not found
* -1 ... fatal error
*/
extern int ntutils_nam2pid( const char * name );
/*
* ntutils_pid2hwnd
*
* PURPOSE: retreives the HWND of the main window of a process whose
pid is specified
*
* PARAMS: pid ... pid of executable
* parent ... handle of parent window (0 for any)
*
* RETURNS: >=0 ... HWND of searched process or 0 if not found
*/
extern HWND ntutils_pid2hwnd( int pid , HWND parent);
/*
* ntutils_nam2hwnd
*
* PURPOSE: retreives the HWND of the main window of a process whose
executable-name is specified
*
* PARAMS: name ... name of executable (with or without extension)
* parent ... handle of parent window (0 for any)
*
* RETURNS: >=0 ... HWND of searched process or 0 if not found
*/
extern HWND ntutils_nam2hwnd( const char * name , HWND parent );
/*
* ntutils_dock
*
* PURPOSE: tries to dock a given window into another window
*
* PARAMS: child ... window handle of child window to dock
* parent ... window handle of new parent window
*
* RETURNS: 0 ... success, -1 otherwise
*/
extern int ntutils_dock( HWND child, HWND parent);
/*
* ntutils_is_main_wnd
*
* PURPOSE: checks wheather the given window is a top level window
*
* PARAMS: hwnd ... handle of window to check
*
* RETURNS: 0 ... no, 1 ... yes
*/
extern int ntutils_tlwnd( HWND hwnd);
/*
* ntutils_post2all
*
* PURPOSE: posts a message to all non-system windows of the
* specified process
*
* PARAMS: pid ... pid of process
* parent ... handle of parent window (0 for any)
* msg ... message to post
* wParam ... first message parameter
* lParam ... second message parameter
*
* RETURNS: 0 ... success
* -1 ... no windows found
*/
extern int ntutils_post2all( int pid , HWND parent,
UINT Msg, WPARAM wParam, LPARAM lParam);
#ifdef __cplusplus
}
#endif
#endif /* _NTUTILS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -