
binbinhfr
Active Members-
Posts
24 -
Joined
-
Last visited
binbinhfr's Achievements

Seeker (1/7)
0
Reputation
-
Hi @JAPP Thanks fo your help. It's exactly what I needed !
-
It happens again yesterday. I did look at the handle using Process Explorer which is a quite precise tool from MS : https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer I found 4 reference to my EXE running. But impossible to kill any of the 4 tasks with the "kill" button... Do you have a trick to kill them "harder" ?
-
Detect program lose or gain focus/active window
binbinhfr replied to binbinhfr's topic in AutoIt GUI Help and Support
So I tried the accelerators, but they works randomly, very strange. Infact, it seems that I need to click the button once before being able to use the accelerator bound to this button... Do I miss something ? Note that my hotkeys worked fine directly calling the callback of the same button. Forget it, I made an error with the array size, that must be precise.... -
binbinhfr reacted to a post in a topic: Detect program lose or gain focus/active window
-
Detect program lose or gain focus/active window
binbinhfr replied to binbinhfr's topic in AutoIt GUI Help and Support
😃 nice ! Thanks -
binbinhfr reacted to a post in a topic: Detect program lose or gain focus/active window
-
Detect program lose or gain focus/active window
binbinhfr replied to binbinhfr's topic in AutoIt GUI Help and Support
oh great, I did not know this one ! but as I see, you can only attach keys to existing Controls. Not possible to have a key attached to a function (or maybe with a trick using hidden controls ?). But it's already a big help ! Thanks. -
How to set properly a Win DLL callback ?
binbinhfr posted a topic in AutoIt General Help and Support
Hi, I am trying to receive MIDI messages from a MIDI device. I can open it and send out MIDI messages, but I have more problems to receive MIDI messages. It is based on events, and I have problem interfacing with the window API. Basically I have 2 functions : midiInOpen (that opens for reception, with a reference to a callback function that I must provide (using the CALLBACK_FUNCTION flag) https://docs.microsoft.com/en-us/previous-versions/ms711610(v=vs.85) and the callback function itself, midiInProc https://docs.microsoft.com/en-us/previous-versions/ms711612(v=vs.85) (I wonder what is this function infact, because I have to write my own... is it a template ?) So how to write my own MidInProc, and how to declare it properly in the midiInOpen call ??? Here is what I wrote but it is not working, even though the midiInOpen returns no error (so the device is opened, but the callback does not give any result when MIDI data is coming).... So I wonder if it's the right way to use DllCallbackRegister and DLLCallbackGetPtr, and if I understood the params declaration... Especially in my MidiWinProc2 definition, where finally I do not give any type/size to these params... But I suppose it is the role of DllCallbackRegister ? global $cbHandle = DllCallbackRegister("MidiWinProc2", "int", "int;uint;dword_ptr;dword_ptr;dword_ptr") $iRet = _MidiIn_Open($nMidiInDevice, DllCallbackGetPtr($cbHandle), 0, BitOR($CALLBACK_FUNCTION, $MIDI_IO_STATUS)) Func MidiWinProc2($hMidiIn,$wMsg,$dwInstance,$dwParam1,$dwParam2) debug("midi in 2") EndFunc Func _MidiIn_Open($uDeviceID, $dwCallback, $dwCallbackInstance, $dwFlags) Local $aResult = DllCall($MIDI_WinMM_DLL,"int","midiInOpen","int*", 0,"uint_ptr",$uDeviceID,"dword_ptr",$dwCallback,"dword_ptr",$dwCallbackInstance,"dword",$dwFlags) If @error Or Not IsArray($aResult) Then Return SetError(1, 1, False) If $aResult[0] = $MMSYSERR_NOERROR Then Return 1 ElseIf $aResult[0] = $MMSYSERR_ALLOCATED Then Return SetError(1,1,0) ElseIf $aResult[0] = $MMSYSERR_BADDEVICEID Then Return SetError(2,2,0) ElseIf $aResult[0] = $MMSYSERR_INVALFLAG Then Return SetError(3,3,0) ElseIf $aResult[0] = $MMSYSERR_INVALPARAM Then Return SetError(4,4,0) ElseIf $aResult[0] = $MMSYSERR_NOMEM Then Return SetError(5,5,0) Else Return SetError(6,6,0) EndIf EndFunc ; Thanks for your help