Search results for 'SendMessage'. 2 post(s) found.
The following code is used to insert a character into another application - Notepad.
procedure TForm1.Button1Click(Sender: TObject) ;
var g,d:integer;
begin
{Find the main window of the Application}
g:=FindWindow('Notepad',nil) ;
{Find the window of the application's text box}
d:=ChildWindowFromPoint(g,point(50,50)) ;
{Now send it a character!!}
SendMessage(d,WM_CHAR,Ord('A'),0) ;
end;
var g,d:integer;
begin
{Find the main window of the Application}
g:=FindWindow('Notepad',nil) ;
{Find the window of the application's text box}
d:=ChildWindowFromPoint(g,point(50,50)) ;
{Now send it a character!!}
SendMessage(d,WM_CHAR,Ord('A'),0) ;
end;
Another posts included in "Delphi"
| How to save text from Clipboard to a file (0) | 2007/09/25 |
| How to show window contents while dragging (0) | 2007/09/25 |
| How to use TTF Font Without Installing (0) | 2007/09/25 |
| How to restrict mouse movement (0) | 2007/09/25 |
| List Devices (LPT, COM ports, ...) (0) | 2007/09/25 |
| How to know whether the font is TrueTypeFont or not (0) | 2007/09/25 |
| How to track a user's idle time (0) | 2007/09/25 |
| How to remove your application from TaskBar (0) | 2007/09/25 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 03:54
moneyideas
-
Subject different money making ideas
2010/01/29 12:46
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
Here's how to chane the bitmap on the Windows Start Button:
{We'll need several global variables}
var
Form1: TForm1;
StartButton : hWnd;
OldBitmap : THandle;
NewImage : TPicture;
...
{Now, we put this code in the
OnCreate event of the form:}
procedure TForm1.FormCreate(Sender: TObject) ;
begin
NewImage:=TPicture.create;
NewImage.LoadFromFile('C:\Windows\Circles.BMP') ;
StartButton := FindWindowEx
(FindWindow(
'Shell_TrayWnd', nil),
0,'Button', nil) ;
OldBitmap:=SendMessage(StartButton,
BM_SetImage, 0,
NewImage.Bitmap.Handle) ;
end;
...
{And this other in the OnDestroy:}
procedure TForm1.FormDestroy(Sender: TObject) ;
begin
SendMessage(StartButton,BM_SetImage,0,OldBitmap) ;
NewImage.Free;
end;
var
Form1: TForm1;
StartButton : hWnd;
OldBitmap : THandle;
NewImage : TPicture;
...
{Now, we put this code in the
OnCreate event of the form:}
procedure TForm1.FormCreate(Sender: TObject) ;
begin
NewImage:=TPicture.create;
NewImage.LoadFromFile('C:\Windows\Circles.BMP') ;
StartButton := FindWindowEx
(FindWindow(
'Shell_TrayWnd', nil),
0,'Button', nil) ;
OldBitmap:=SendMessage(StartButton,
BM_SetImage, 0,
NewImage.Bitmap.Handle) ;
end;
...
{And this other in the OnDestroy:}
procedure TForm1.FormDestroy(Sender: TObject) ;
begin
SendMessage(StartButton,BM_SetImage,0,OldBitmap) ;
NewImage.Free;
end;
Another posts included in "Delphi"
| How to Close Another Application by Windows Caption (0) | 2007/09/19 |
| Controling sound volume from code (0) | 2007/09/19 |
| Copying Group of Files using Delphi with Standard Animation Dialog (SHF... (0) | 2007/09/19 |
| How to capture the output from a DOS (command/console) Window (0) | 2007/09/19 |
| How to Activate/Deactivate the Screen Saver (0) | 2007/09/19 |
| Retrieving all image links from an HTML document (0) | 2007/09/18 |
| List All Network Drives (0) | 2007/09/18 |
| How to set the "home page" for the Internet Explorer from Delphi code (0) | 2007/09/18 |
Trackback : Cannot send a trackbact to this post.
-
Subject Cheap valium no prescription.
2009/04/08 13:58
Buy valium online without prescription. Valium no prescription. No prescription valium. Buy valium online without a prescription. Valium prescription online. Buy valium without prescription. Generic valium no prescription.
-
Subject Ambien no prescription needed.
2009/04/08 20:22
Online meds no prescription ambien. Cheaper ambien prescription.
-
Subject different money making ideas
2010/01/29 04:01
moneyideas
-
Subject different money making ideas
2010/01/29 13:04
moneyideas
-
Subject different money making ideas
2010/01/31 16:40
moneyideas

Prev

Rss Feed