I know this is an old thread, but can provide a simple example of a browser in a dialog using the current version of quickmacros, with forward,backward,stop,refresh and home button please?
int- t_hdlg __ImageList-- t_il sel message ,caseWM_INITDIALOG ,t_hdlg=hDlg ,DT_SetAutoSizeControls hDlg "3s 5sh" ,sub.ToolbarInitid(4 hDlg) t_il , ,SHDocVw.WebBrowser we3 ,we3._getcontrol(id(3 hDlg)) ,we3._setevents("sub.we3") , ,we3.Silent=TRUE;;prevent script error messages ,we3.Navigate("http://www.google.com");;or we3.GoHome , ,caseWM_COMMANDgoto messages2 ret ;messages2 sel wParam ,case [101,102,103,104,105,106] ,err- ,we3._getcontrol(id(3 hDlg)) ,sel wParam ,,case101 we3.GoBack ,,case102 we3.GoForward ,,case103 we3.Stop ,,case104 we3.Refresh ,,case105 we3.GoHome ,,case106 we3.Navigate(_s.getwintext(id(5 hDlg))) ,err+ , ,caseIDOK ,if(GetFocus=id(5 hDlg))PostMessage hDlg WM_COMMAND1060;;on Enter press Go ,ret0;;disable closing on Enter ,caseIDCANCEL ,ifk(Z)ret0;;disable closing on Esc ret1
#sub ToolbarInit function htb __ImageList&il
il.Load("$qm$\il_qm.bmp");;load an imagelist created with the imagelist editor ;;or ;il.Load("resource:<QM web browser>image:QM web browser") ;;load an imagelist created with the imagelist editor and added to macro resources ;;or ;il.Create("file1.ico[]file2.ico[]file3.ico") ;;create imagelist at run time from icons. Slower.
SendMessage htb TB_SETIMAGELIST0 il SetWinStyle htb TBSTYLE_FLAT|TBSTYLE_TOOLTIPS1
ARRAY(str) as="Back[]Forward[]Stop[]Refresh[]Home[]Go" ARRAY(TBBUTTON) ab.create(as.len) int i for i 0 ab.len ,TBBUTTON& t=ab[i] ,t.idCommand=101+i ,t.iBitmap=i ,t.iString=SendMessage(htb TB_ADDSTRINGA0 as[i]) ,t.fsState=TBSTATE_ENABLED
I notice when I compiled it into standalone exe, whenever I run it on a computer, an empty My QM folder is created in my documents folder. Is there a setting to prevent the compiled standalone exe from creating that folder?
This bug will be fixed in next QM version.
Or you can fix it now. Download and unzip the attached file to the QM folder. Usually it is C:\Program files (x86)\Quick Macros 2. Then re-make all your QM-created exe files that will live on other computers.
See the updated example. Use the il.Create(...) line instead of il.Load(...).
But with an imagelist .bmp file the dialog will be loaded faster, because don't need to load many .ico files at run time. To make it work:
Open the imagelist editor. It is in the floating toolbar, "more tools" button.
Create new imagelist: click the combo box, "<New>".
Click "Add" and read how to add icons. Add icons.
Click "More Actions", "Open imagelist folder". You will see a new .bmp file.
You can use this file in macros, for example il.Load($my qm$\imagelists\QM web browser.bmp).
If you'll use it in .exe, you can copy the .bmp file to your exe folder and use il.Load($qm$\imagelists\QM web browser.bmp).
Or you can add the .bmp file to macro resources: menu Tools -> Resources -> Import from file. Then use code: il.Load("resource:<QM web browser>image:QM web browser").