Search results for 'Windows API'. 31 post(s) found.
- 2007/09/25 Window flashing
- 2007/09/25 How to use TTF Font Without Installing
- 2007/09/25 How to show window contents while dragging
- 2007/09/25 How to save text from Clipboard to a file
- 2007/09/25 How to send char as message to another application
- 2007/09/25 How to restrict mouse movement
- 2007/09/25 List Devices (LPT, COM ports, ...)
- 2007/09/25 How to know whether the font is TrueTypeFont or not
- 2007/09/25 How to track a user's idle time
- 2007/09/25 How to remove your application from TaskBar
Flashing a window means changing the appearance of its caption bar as if the window were changing from inactive to active status, or vice versa.
Typically, a window is flashed to inform the user that the window requires attention but that it does not currently have the keyboard focus.
The FlashWindow API function flashes the window only once.
To create a flashing window add a TTimer component on a form, and use the following code in the OnTimer event handler:
Another posts included in "Delphi"
| Technology sharing related with software development. Specially content... (0) | 2007/10/02 |
| Creating thumbnail images (0) | 2007/10/04 |
| How to encrypt a string (0) | 2007/10/04 |
| How to use TTF Font Without Installing (0) | 2007/09/25 |
| How to show window contents while dragging (0) | 2007/09/25 |
| How to save text from Clipboard to a file (0) | 2007/09/25 |
| How to send char as message to another application (0) | 2007/09/25 |
| How to restrict mouse movement (0) | 2007/09/25 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 01:44
moneyideas
-
Subject different money making ideas
2010/01/29 09:57
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
Here's how to use a TTF (true type font) in your Delphi application without having to install it in Windows:
1. In the OnCreate event for the main form in your Delphi application call the AddFontResource API function. The AddFontResource function adds the font resource from the specified file to the system font table.
2. When an application no longer needs a font resource that it loaded by calling the AddFontResource function, it must remove that resource by calling the RemoveFontResource function. Do this in the OnDestroy event for the main form.
begin
AddFontResource('c:\FONTS\MyFont.TTF') ;
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ;
end;
{Before application terminates we must remove our font:}
procedure TForm1.FormDestroy(Sender: TObject; var Action: TCloseAction) ;
begin
RemoveFontResource('C:\FONTS\MyFont.TTF') ;
SendMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0) ;
end;
Another posts included in "Delphi"
| Window flashing (0) | 2007/09/25 |
| Technology sharing related with software development. Specially content... (0) | 2007/10/02 |
| Creating thumbnail images (0) | 2007/10/04 |
| How to show window contents while dragging (0) | 2007/09/25 |
| How to save text from Clipboard to a file (0) | 2007/09/25 |
| How to send char as message to another application (0) | 2007/09/25 |
| How to restrict mouse movement (0) | 2007/09/25 |
| List Devices (LPT, COM ports, ...) (0) | 2007/09/25 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/25 08:18
moneyideas
-
Subject different money making ideas
2010/01/28 21:37
moneyideas
-
Subject different money making ideas
2010/01/29 06:09
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
-
Subject Phentermine 37.5 mg online prescription.
2010/03/05 07:58
Phentermine online. Lowest online phentermine price. Online phentermine. Lowes t online phentermine price.
-
Subject Cheap 37 5 phentermine.
2010/03/07 23:04
Cheap phentermine. Phentermine cheap. Cheap phentermine online no rx saturday delivery. Cheap phentermine online. Cheap phentermine cod.
-
Subject Buy phentermine online.
2010/03/09 16:38
Buy phentermine online buy. Buy phentermine. Buy phentermine online without a prescription. Buy phentermine online no prescription. Buy phentermine mexico. Buy phentermine on line to nevada. Buy no phentermine prescription. Buy cheap phentermine.
Here's how to enable or disable the "Show window contents while dragging" Windows fature from Delphi code:
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 1, nil, 0) ;
//To disable this option call the function:
SystemParametersInfo(SPI_SETDRAGFULLWINDOWS, 0, nil, 0) ;
Another posts included in "Delphi"
| How to use TTF Font Without Installing (0) | 2007/09/25 |
| Window flashing (0) | 2007/09/25 |
| Technology sharing related with software development. Specially content... (0) | 2007/10/02 |
| How to save text from Clipboard to a file (0) | 2007/09/25 |
| How to send char as message to another application (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 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/28 22:26
moneyideas
-
Subject different money making ideas
2010/01/29 06:42
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
If you want to save the text data contained in the Clipboard to a text file on a disk, use the next code:
Usage:
ClipboardTxtToFile(c:\dir\cliptext.txt)
}
uses Clipbrd;
function ClipboardTxtToFile
(sFileTXT : string) : boolean;
var
ps1, ps2 : PChar;
dwLen : DWord;
tf : TextFile;
hData : THandle;
begin
Result := False;
with Clipboard do begin
try
Open;
if(HasFormat(CF_TEXT)) then begin
hData := GetClipboardData(CF_TEXT) ;
ps1 := GlobalLock(hData) ;
dwLen := GlobalSize(hData) ;
ps2 := StrAlloc(1 + dwLen) ;
StrLCopy( ps2, ps1, dwLen ) ;
GlobalUnlock( hData ) ;
AssignFile(tf, sFileTXT) ;
ReWrite(tf) ;
Write(tf, ps2) ;
CloseFile(tf) ;
StrDispose( ps2 ) ;
Result := True;
end;
finally
Close;
end;
end;
end;
Another posts included in "Delphi"
| How to show window contents while dragging (0) | 2007/09/25 |
| How to use TTF Font Without Installing (0) | 2007/09/25 |
| Window flashing (0) | 2007/09/25 |
| How to send char as message to another application (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 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 03:13
moneyideas
-
Subject different money making ideas
2010/01/29 12:10
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
The following code is used to insert a character into another application - Notepad.
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 restrict the mouse movement to a form and release this restriction after a click on a form:
var r : TRect;
begin
//it would be good idea to move the
//mouse inside the form before restriction
r := BoundsRect;
ClipCursor(@R) ;
end;
procedure TForm1.FormClick(Sender: TObject) ;
begin
//always be sure to release the cursor
ClipCursor(nil) ;
end;
Another posts included in "Delphi"
| How to send char as message to another application (0) | 2007/09/25 |
| How to save text from Clipboard to a file (0) | 2007/09/25 |
| How to show window contents while dragging (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 |
| How to play sounds on the PC Speaker ? (0) | 2007/09/20 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/28 22:28
moneyideas
-
Subject different money making ideas
2010/01/29 06:39
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
The following procedure will list all the devices on your computer. You can then extract the com ports and printer ports by looking for the 'COM' and 'LPT' characters in the list.
Add a Memo and a Button and place this code in the OnClick of a button...
var
istr: string;
isize, j: dword;
begin
setlength(istr, 4000) ;
isize := QueryDosDevice(nil, @istr[1], 4000) ;
for j := 1 to isize do
if istr[j] = #0 then istr[j] := #10;
memo1.lines.CommaText := istr;
end;
Another posts included in "Delphi"
| How to restrict mouse movement (0) | 2007/09/25 |
| How to send char as message to another application (0) | 2007/09/25 |
| How to save text from Clipboard to a file (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 |
| How to play sounds on the PC Speaker ? (0) | 2007/09/20 |
| How to install an INF file using Delphi ? (0) | 2007/09/20 |
Trackback : Cannot send a trackbact to this post.
-
Subject Percocet.
2009/03/17 14:40
How long does percocet 7.5 stay in your system. Symtoms of withdrawl from percocet. Percocet. Percocet 93-490 10 mg.
-
Subject Weight gain and nexium.
2009/04/18 17:29
Generic name nexium. Side effects from going off nexium. Nexium.
-
Subject Viagra.
2009/05/02 15:03
Viagra. Free viagra. Re viagra cello. Buy viagra uk.
-
Subject different money making ideas
2010/01/29 00:55
moneyideas
-
Subject different money making ideas
2010/01/29 09:26
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
Given a font's name (such as Arial,Verdana, Times New Roman, etc), function returns a boolean value indicating whether the font is or isn't a True Type font.
const
PITCH_MASK: byte = $0F;
var
TxMet: TTextMetric;
TempCanvas : TCanvas;
PitchTest : byte;
begin
TempCanvas:=TCanvas.Create;
TempCanvas.Handle:=CreateCompatibleDC(0) ;
TempCanvas.Font.Name:=FontName;
GetTextMetrics(TempCanvas.Handle, TxMet) ;
PitchTest:=TxMet.tmPitchAndFamily and PITCH_MASK;
Result:=(PitchTest and TMPF_TRUETYPE) <> 0;
TempCanvas.free;
end;
Another posts included in "Delphi"
| List Devices (LPT, COM ports, ...) (0) | 2007/09/25 |
| How to restrict mouse movement (0) | 2007/09/25 |
| How to send char as message to another application (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 |
| How to play sounds on the PC Speaker ? (0) | 2007/09/20 |
| How to install an INF file using Delphi ? (0) | 2007/09/20 |
| How to determine the output of a console application ? (0) | 2007/09/20 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 00:44
moneyideas
-
Subject different money making ideas
2010/01/29 09:01
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
Suppose you have a data-critical type of application where you would not want a non-authored user to work with the data. Such an application could automatically log out the current user if no user activity has taken place in a lengthy time.
To track a user's idle time you could hook keyboard and mouse activity. Note, however, that installing a system-wide message hook is a very invasive thing to do and should be avoided if possible, since it will require your hook DLL to be loaded into all processes.
Another solution is to use the GeTLastInputInfo API function (if your application is running on Win2000 (and up) machines).
GeTLastInputInfo retrieves the time (in milliseconds) of the last input event (when the last detected user activity has been received, be it from keyboard or mouse).
Here's a simple example.
The SecondsIdle function returns a number of second with no user activity (called in an OnTimer event of a TTimer component).
var
liInfo: TLastInputInfo;
begin
liInfo.cbSize := SizeOf(TLastInputInfo) ;
GeTLastInputInfo(liInfo) ;
Result := (GetTickCount - liInfo.dwTime) DIV 1000;
end;
procedure TForm1.Timer1Timer(Sender: TObject) ;
begin
Caption := Format('System IDLE last %d seconds', [SecondsIdle]) ;
end;
Another posts included in "Delphi"
| How to know whether the font is TrueTypeFont or not (0) | 2007/09/25 |
| List Devices (LPT, COM ports, ...) (0) | 2007/09/25 |
| How to restrict mouse movement (0) | 2007/09/25 |
| How to remove your application from TaskBar (0) | 2007/09/25 |
| How to play sounds on the PC Speaker ? (0) | 2007/09/20 |
| How to install an INF file using Delphi ? (0) | 2007/09/20 |
| How to determine the output of a console application ? (0) | 2007/09/20 |
| Get text from the control at pos x,y on screen (0) | 2007/09/20 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/29 05:01
moneyideas
-
Subject different money making ideas
2010/01/29 13:54
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas
If you need to hide your application from the Windows TaskBar, you can use the following trick:
begin
ShowWindow(Application.Handle, SW_HIDE) ;
SetWindowLong(Application.Handle, GWL_EXSTYLE,
getWindowLong(Application.Handle, GWL_EXSTYLE) or
WS_EX_TOOLWINDOW) ;
ShowWindow(Application.Handle, SW_SHOW) ;
end;
Another posts included in "Delphi"
| How to track a user's idle time (0) | 2007/09/25 |
| How to know whether the font is TrueTypeFont or not (0) | 2007/09/25 |
| List Devices (LPT, COM ports, ...) (0) | 2007/09/25 |
| How to play sounds on the PC Speaker ? (0) | 2007/09/20 |
| How to install an INF file using Delphi ? (0) | 2007/09/20 |
| How to determine the output of a console application ? (0) | 2007/09/20 |
| Get text from the control at pos x,y on screen (0) | 2007/09/20 |
| Get dimensions of usable space on monitor (work area) (0) | 2007/09/20 |
Trackback : Cannot send a trackbact to this post.
-
Subject different money making ideas
2010/01/28 23:46
moneyideas
-
Subject different money making ideas
2010/01/29 08:18
moneyideas
-
Subject different money making ideas
2010/01/31 16:41
moneyideas

Prev

Rss Feed