The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 895 - File: showthread.php PHP 7.2.34 (Linux)
File Line Function
/showthread.php 895 errorHandler->error




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Customize hotkey switch URL
#1
Hello everyone,

I would like to use custom hotkeys to help me implement some functions, but I have encountered some problems, and I hope someone can point them out:

1. I want to use F1 to switch the address of the web page, but why can't the we4 object be called directly?

2. I disabled the default hotkey ctrl+c, but I want to toggle disable and enable(ctrl+c) by pressing F12. How to do it?

Thanks in advance

Macro Macro7
Code:
Copy      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90CA0AC8 0x0 0 0 900 432 "dialog"
;4 ActiveX 0x54030000 0x0 0 0 900 432 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "4"
str ax4SHD
ax4SHD="www.bing.com"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret

#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,DT_SetAccelerators hDlg "401 F1[]402 F2[]403 F3[]404 F4[]405 Cc[]412 F12"
,SHDocVw.WebBrowser we4
,we4._getcontrol(id(4 hDlg))
,DT_SetAutoSizeControls(hDlg "4s")

,case WM_DESTROY
,case WM_COMMAND goto messages2
,case WM_CLOSE
,DT_Ok(hDlg)
ret
;messages2
sel wParam
,case IDOK
,ifk(Y)
,,key Y           ;; Enter
,,ret 0
,case IDCANCEL
,ret 0
,case 401 ;;mes "F1"
,we4.Navigate("http://www.google.com")
,case 402 ;;mes "F2"
,we4.Navigate("http://www.facebook.com")
,case 403 ;;mes "F3"
,we4.Navigate("http://www.sina.com")
,case 404 ;;mes "F4"
,we4.Navigate("http://www.baidu.com")
,case 405 ;;mes "ctrl+c"
,
,case 412 ;;mes "F12"
,
ret 1


Messages In This Thread
Customize hotkey switch URL - by win - 05-23-2018, 01:32 AM
RE: Customize hotkey switch URL - by Kevin - 05-23-2018, 01:59 AM
RE: Customize hotkey switch URL - by win - 05-23-2018, 03:12 AM
RE: Customize hotkey switch URL - by Kevin - 05-23-2018, 03:25 AM
RE: Customize hotkey switch URL - by win - 05-23-2018, 03:33 AM
RE: Customize hotkey switch URL - by Kevin - 05-23-2018, 03:42 AM
RE: Customize hotkey switch URL - by win - 05-23-2018, 03:46 AM
RE: Customize hotkey switch URL - by Kevin - 05-23-2018, 04:01 AM
RE: Customize hotkey switch URL - by win - 05-23-2018, 04:28 AM
RE: Customize hotkey switch URL - by Kevin - 05-23-2018, 04:37 AM
RE: Customize hotkey switch URL - by win - 05-24-2018, 07:14 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)