1 #include<windows.h> 2 //通用字符串的定义头文件 3 #include<tchar.h> 4 5 6 7 //消息回调函数 8 LRESULT CALLBACK WindowProc( 9 HWND hWnd, //窗口句柄 10 UINT uMsg, //消息ID 11
program Monitor; // {$APPTYPE CONSOLE} uses Winapi.Windows, System.SysUtils, ProcLib in 'ProcLib.pas'; var Mutex: HWND; const c_AppName = 'server.exe'
分类:
系统相关 时间:
2016-03-03 01:21:34
阅读次数:
228
简单的说就是取鼠标所在位置对应的窗口句柄?procedure TForm1.Timer1Timer(Sender: TObject);vara:TPoint; //用来存放坐标hw:HWND; //用来存放窗口句柄begin GetCursorPos(a); //取得鼠标坐标,并存放进a中 hw :
函数功能:该函数将指定的消息发送到一个或多个窗口。此函数为指定的窗口调用窗口程序,直到窗口程序处理完消息再返回。该函数是应用程序和应用程序之间进行消息传递的主要手段之一。 函数原型:LRESULT SendMessage(HWND hWnd,UINT Msg,WPARAM wParam,LPARAM
1、 1 #include <windows.h> 2 3 4 LRESULT CALLBACK ProcWindow(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 5 void QuitWindow(); 6 7 HINSTANCE g_
SetForegroundWindowSwitchToThisWindow procedure TApplication.BringToFront;varTopWindow: HWnd;beginif Handle <> 0 thenbeginTopWindow := GetLastActivePo
这是取得DC句柄的其中一种方法(会重定义原点和建立新的剪裁区): function TControl.GetDeviceContext(var WindowHandle: HWnd): HDC; begin if Parent = nil then raise EInvalidOperation.C
分类:
其他好文 时间:
2016-02-26 21:59:14
阅读次数:
238
1、 1 #include <windows.h> 2 3 4 LRESULT CALLBACK ProcWindow(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); 5 void QuitWindow(); 6 7 HINSTANCE g_
DELPHI 通過窗口句柄或窗口标题得到进程句柄2009年05月08日 星期五 10:15procedure TForm1.Button1Click(Sender: TObject);varhWindow: HWND; { 窗体句柄 }dwProcessID: DWORD; { 进程 ID }hPr
句柄概念在WINDOWS编程中是一个很重要的概念,在许多地方都扮演着重要的角色。但由此而产生的句柄概念也大同小异,比如:<<Microsoft Windows 3 Developer's Workshop>>(Microsoft Press,by Richard Wilton)一书中句柄的概念是:在
分类:
其他好文 时间:
2016-02-25 19:49:26
阅读次数:
146