I wrote two macro, one is the installation of imindq code, set trigger hotkey for Ctrl+F10, another is imindq uninstall code, set trigger hotkey for Ctrl+F11, I put two macro to generate exe, run the EXE file on the other computer, hotkey is invalid, then I QM help file query to export exe files, will trigger failure! What method, can be two pieces of code written to a macro file, export EXE file, and can correct hotkey response? Just learning QM, not very proficient, thank you very much!
#region Recorded 2016-12-28 20:14:44 run"$qm$\iMindQ_8_1_1_51836.exe"
int w2=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4311id(2851 w2)1;;push button 'Next >' wait0-WV w2
int w3=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef2110id(2689 w3)1;;radio button 'I accept the terms in the l...' lef4510id(2851 w3)1;;push button 'Next >' wait0-WV w3
Exe don't have triggers.
One of workarounds - create shortcut to the exe on desktop or somewhere in Start menu. Assign a hotkey to the shortcut in its Properties dialog.
I try in the above code, add the following code, the successful implementation of the response trigger, but do not know how to make the two code together respectively in response to trigger hotkey, hope in the later version: QM can achieve the EXE file response trigger hotkey, using AutoHotkey is easy to implement!
#sub install spe100 #region Recorded 2016-12-28 20:14:44 run"$qm$\iMindQ_8_1_1_51836.exe"
int w2=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4311id(2851 w2)1;;push button 'Next >' wait0-WV w2
int w3=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef2110id(2689 w3)1;;radio button 'I accept the terms in the l...' lef4510id(2851 w3)1;;push button 'Next >' wait0-WV w3
int w5=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4114id(2922 w5)1;;push button 'Install' wait0-WV w5
int w6=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) wait0-WV w6
int w7=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4114id(2890 w7)1;;push button 'Finish' #endregion
#sub uninstall spe100 #region Recorded 2016-12-28 20:13:55 run"$qm$\iMindQ_8_1_1_51836.exe"
int w=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef397id(2851 w)1;;push button 'Next >' wait0-WV w
int w3=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4214id(624 w3)1;;radio button 'Remove' lef417id(2851 w3)1;;push button 'Next >' wait0-WV w3
int w4=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef417id(2974 w4)1;;push button 'Remove' wait0-WV w4
int w5=wait(0 WA win("iMindQ® Installer Information""MsiDialogNoCloseClass")) lef4017id(11 w5)1;;push button 'Yes' wait0-WV w5
int w6=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) wait0-WV w6
int w7=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef3614id(2890 w7)1;;push button 'Finish'
#endregion
Here everything is in 1 exe. If need 3 exe, remove everything below the DispatchMessage line and replace mac "sub.install" etc with run "$qm$\iMindQ_8_1_1_51836.exe" etc.
generate exe file before,add a few lines of code above can be accessed to achieve the trigger function, respond to the trigger!
I hope the future QM version can automatically add the above code to generate exe file, which will Is very useful, or reference Autohotkey way to achieve!
Hope that QM continue to absorb some of the advantages of AHK, become more and more powerful!
Recommended to use the above code to generate the exe file, run-time, in the lower right corner of the taskbar shows the status icon, click the icon, I can close or pause the program, otherwise the program will continue to run, can not see the state!
AddTrayIcon"$system$\shell32.dll,2""iMindQ setup. Ctrl+click to exit." int vk=wait(0 K F10) int vk1=wait(0 K F11)
if vk(?????) ,mac"sub.install"
if vk1(????) ,mac"sub.uninstall"
#sub install spe100 #region Recorded 2016-12-28 20:14:44 ;run "$qm$\iMindQ_8_1_1_51836.exe" run"$desktop$\iMindQ_8_1_1_51836.exe"
int w2=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4311id(2851 w2)1;;push button 'Next >' wait0-WV w2
int w3=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef2110id(2689 w3)1;;radio button 'I accept the terms in the l...' lef4510id(2851 w3)1;;push button 'Next >' wait0-WV w3
int i k vk mod rep ,i=QmKeyCodeToVK(qmKeyCode k) ,if(i=0)break ,qmKeyCode+i ,sel k ,,caseVK_CONTROL mod|MOD_CONTROL ,,caseVK_SHIFT mod|MOD_SHIFT ,,caseVK_MENU mod|MOD_ALT ,,caseVK_LWIN mod|MOD_WIN ,,caseelse vk=k
__RegisterHotKey hk1.Register2(01"CF10");;Ctrl+F10 __RegisterHotKey hk2.Register2(02"CF11") MSG m rep ,if(GetMessage(&m 000)<1)break ,if(m.message!=WM_HOTKEY)continue , ,;edit this code if need. The numbers must match the numbers passed to Register2. ,sel m.wParam ,,case1 ,,sub.install;;or can be: mac "sub.install" ,, ,,case2 ,,sub.uninstall;;or can be: mac "sub.uninstall"
The above syntax, I found in the use of WinAutomation software, the following is a video demo link! I feel QM should also be able to achieve, but because I am not very good programming code, I hope QM can learn the advantages of WinAutomation software, become more powerful! thank you very much!
int i k vk mod rep ,i=QmKeyCodeToVK(qmKeyCode k) ,if(i=0)break ,qmKeyCode+i ,sel k ,,caseVK_CONTROL mod|MOD_CONTROL ,,caseVK_SHIFT mod|MOD_SHIFT ,,caseVK_MENU mod|MOD_ALT ,,caseVK_LWIN mod|MOD_WIN ,,caseelse vk=k
__RegisterHotKey hk1.Register2(01"CF10");;Ctrl+F10 __RegisterHotKey hk2.Register2(02"CF11") MSG m rep ,if(GetMessage(&m 000)<1)break ,if(m.message!=WM_HOTKEY)continue , ,;edit this code if need. The numbers must match the numbers passed to Register2. ,sel m.wParam ,,case1 ,,sub.install;;or can be: mac "sub.install" ,, ,,case2 ,,sub.uninstall;;or can be: mac "sub.uninstall"
#sub install out1
#sub uninstall out2
In QM,
Ctrl + F10 can return to the numerical? For example, return 1
Ctrl + F11 can return to the numerical? For example, return 2
If can return to the value, I can return to the value of the corresponding code!
My programming ability is not good, so I can only understand the syntax of Winautomation
Winautomation Software, a hotkey, may be assigned a value, the following picture
Can use, but I don't recommend. It is less efficient, less reliable. Would need a loop anyway. Does not support modifier keys; problems with key "eating"; etc.
Gintaras Wrote:Can use, but I don't recommend. It is less efficient, less reliable. Would need a loop anyway. Does not support modifier keys; problems with key "eating"; etc.
rep
,int vk=wait(0 K)
,sel k
,,case VK_F10
,,...
Does not support modifier keys? I tried Ctrl + F10 return value is 17
I use QM to try a lot of software installation process recording, found in each window before, add a window to destroy the code, I will be able to get the perfect! (Below picture)
Hope in the new version QM can automatically identify this problem, automatically add a window to destroy the code,
In the new version is not released, is there any way to quickly add it? I feel a little trouble of manually add,thank you very much
See the following code:When the (mac "sub.install") code is run, when I press Ctrl + F10,the code (mac "sub.uninstall") run , but did not respond, where a problem?
#sub install spe100 #region Recorded 2016-12-28 20:14:44 run"$qm$\iMindQ_8_1_1_51836.exe"
int w2=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4311id(2851 w2)1;;push button 'Next >' wait0-WV w2
int w3=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef2110id(2689 w3)1;;radio button 'I accept the terms in the l...' lef4510id(2851 w3)1;;push button 'Next >' wait0-WV w3
Your macro is created so that it seems that you want to run sub.install and sub.uninstall simultaneously. Replace mac "sub.install" with sub.install, and mac "sub.uninstall" with sub.uninstall, and wait(0 K CF10) with wait(0 K F10).
I tried, as if only to respond to F1-F12 but can not respond to key combinations: For example: Ctcrl + F10, or to achieve some trouble, I hope the future can be simple to achieve
Autohotkey set up hotkey trigger, very convenient, and has been in force, I would like add AHK trigger to QM code, calling QM sub, how to achieve? I made the following settings, but debugging, there was an error, I hope someone can guide me, any comments and suggestions are welcome, and very grateful :oops:
I don't know, you can ask in AHK forums: How to call host's callback functions from AHK script when using function ahktextdll of the AHK COM component? Maybe can use COM events for it.
I mean: The following three files written to a code QM document,And finally generate exe file, and auhotkey.dll file to find packages together, copy to another computer:
1.AHK response hotkey code is relatively simple(In QM, the definition of the trigger hotkey code, more difficult to understand)
2.QM recording installation code is relatively simple(In the AHK, there is no recording feature, code handwriting more difficult)
3.QM recording uninstallation code is relatively simple(In the AHK, there is no recording feature, code handwriting more difficult)
QM can call the AHK dll file, so: I want the following three files of the code, write to a QM, the generated exe file, in other computers also successfully run
can I achieve?
————————————————————————————————————
1.The first file: trigger hotkey.ahk
Code:
#region Recorded 2016-12-28 20:14:44 run"$qm$\iMindQ_8_1_1_51836.exe"
int w2=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef4311id(2851 w2)1;;push button 'Next >' wait0-WV w2
int w3=wait(0 WA win("iMindQ® - InstallShield Wizard""MsiDialogCloseClass")) lef2110id(2689 w3)1;;radio button 'I accept the terms in the l...' lef4510id(2851 w3)1;;push button 'Next >' wait0-WV w3