To bypass logon and logoff processes using a script

By creating a script, it is possible automate logging on and logging off. This option will appeal to CQG IC API users and anyone who wants to open and close the software on a particular schedule.

Log on

You can also save this script to Windows Startup (Start > All programs > Startup) to automatically log on whenever Windows starts.

1.  Run: logcln32.exe -user=<login>,[<password>] -silentlogon -host=<login-server-host-name>

      In the folder that contains logcln32.exe (usually C:\Program Files\CQG\CQGNet\Bin), open a command line interface (cmd.exe, for example)

      Type: logcln32.exe -user=username,password -silentlogon -host=hostname

2.  ENTER

Because this process could become tedious, we suggest you create a script/bat file that includes this line.

Log off

Python script:

import win32gui

 

serialNumber = "111111" # your serial number

msg = win32gui.RegisterWindowMessage( "CQG 32 Inter-Task Client " + serialNumber )

hWnd = 0xffff     # HWND_BROADCAST

wParam = 0x1124   # CQGPC_IT_PREPARE_TO_TERMINATE

lParam = 10       # CQGPC_TERMINATE_REASON_INSTALL

win32gui.PostMessage(hWnd, msg, wParam, lParam);

 

 

Reference: http://www.wikihow.com/Write-a-Batch-File