Dear Martyn,
Firstly : I wanted to thank you for taking my question into consideration.
I answered my question ! It is now solved
Finally I found out a mistake in my exploring : instead of simulating the "q" keypress (lowercase) , I compiled a "Q" keypress (uppercase). Therefore it is normal that picoscope.exe did not react to my keyboard customisation.
Silly me.
How I did it : under VB.net 2.0 ( dotNet) 2005 ?
Find attached my ugly trial .. that works.
Working principle:
_ scanning list of windows processes: finding picoscope.exe
_ if pico is found I put it as foreground windows (with Win32 API SetForegroundWindow()).
_ then sending the "q" key --> this opens the "Are you sure to load the config ? " dialog
_ then sending the " " key (spacebar) --> this validates the "YES" option of the dialog "Are you sure to load the config ?" dialog
To send the keystrokes, I used the ugly SendKeys() API
Pre-requisite to run the soft:
1_ a running instance of picoscope.exe with a connected or demo oscilloscope.
2_ to define in picoscope in the menu : TOOL > preference > KEYBOARD tab , with checkbox set to "display all available functions". In the list, under the "settings" branch, type the "q" letter to "load the default settings".
'example of source code -- may not be 100% running
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByRef lParam As Object) As Long
on error resume next
for each lProcessPico as Process In Process.GetProcesses()
SetForegroundWindow(lProcessPico.MainWindowHandle)
SendKeys.Send("q")
SendKeys.Send(" ")
next