Ads 468x60px

Smaller time frame always follow the bigger time frame. It's better wait be patience to enter in position than risk with BIG SL. Having strong trading discipline and taking losses when necessary is a sign of serious trading approach
Subscribe:

Labels

Featured Posts

Tuesday, August 14, 2012

turn on/off my monitors


I have successfully tested this on Windows XP and Windows 7:
const
  MONITOR_ON      = -1;
  MONITOR_OFF     =  2;
  MONITOR_STANDBY =  1;
To turn off the monitor:
  SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);
To turn on the monitor:
  SendMessage(Application.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_ON);


comments

Saturday, August 11, 2012

WINDOWS SERVICES - CONVERTING BETWEEN KEY AND DISPLAY NAMES


We've demonstrated how to check the status of Windows services and how to control them. One element missing from those functions was a way to convert between key and display names of Windows services. 
 
That's right, a Windows service has two names. The long name you see in the Control Panel is the display name of the service. The internal shorter name of the serivce is called the key name. Most functions require that you use the key name of a service, so here's a function to convert a display name to a key name. comments

WINDOWS SERVICES - GETTING A LIST OF INSTALLED SERVICES


Want to get a list of active, inactive or all Windows services? Following function can help you to do this, but be sure to read other Windows services related tips for details. 
 
const
  //
  // Service Types
  //
  SERVICE_KERNEL_DRIVER       = $00000001;
  SERVICE_FILE_SYSTEM_DRIVER  = $00000002;
  SERVICE_ADAPTER             = $00000004;
  SERVICE_RECOGNIZER_DRIVER   = $00000008;
comments

BIN2HEX - SCRIPT TO CONVERT DATA FILES INTO SOURCE CODE ARRAYS


Looking for a way to convert a binary (or even a text) file into a Perl, Pascal/Delphi, C/C++, or Java source code array? For example, you may want to do this to include a GIF or other binary file directly inside your Perl CGI script, rather than reading the data from a file to reduce file access. If you're writing Windows programs, you could use the same method to store resource files in your executable files. 
 
The bin2hex.pl script will take a binary file name and output a source code array, in the specified language, necessary to recreate the input data inside a program.
 
To run the script, first make sure that you have a Perl interpreter installed on your system and download the bin2hex.pl script. Then execute the following command from your command prompt (assuming you want to convert a file named banner.gif to a Perl string):
 
comments

CALLING CONTROL PANEL APPLETS FROM YOUR PROGRAMS AND SCRIPTS


Looking for a way to open Control Panel applets from your programs without opening the Control Panel
 
Whether you want your users to change the system date/time properties, add a new modem or change joystick settings, there's an easy way to call all such Control Panel applets (icons) without opening the Control Panel folder. The good news is that you can use this method in any Windows programming environment or even in a simple BATch file.
 
Running the following command from your program will do the trick (CPL being the file name of the Control Panel applet to open. a list of such applets can be found at the bottom of this document):
 
comments

IS WINDOWS TASKBAR'S AUTO HIDE FEATURE ENABLED?


Want to know if the Windows taskbar's auto hide feature is enabled? Here's a simple function to check this written in C Language / C++ and Delphi. 
 
Delphi CODE
 
uses ShellAPI;

(*
  Returns TRUE if taskbar auto hide is on.

  if(IsTaskBarautoHideOn)then
  begin
    // auto hide is ON
  end;
comments

EASY WAY TO COMPARE DATES


Did you know that you can easily compare dates by using the "EncodeDate()"? Here are some examples: 
 
uses
  SysUtils;

{...}

if(Date > EncodeDate( 1997, 1, 1 ))then
begin
  { display "this program has expired" }
end;

{...}

if( EncodeDate( 1997, 1, 1 )
  > EncodeDate( 1996, 1, 1 ) ) then
begin
  {...}
end;
Listing #1 : Delphi code. Download datecomp (0.27 KB).

comments