Form1.vb 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550
  1. Imports CefSharp
  2. Imports CefSharp.Handler
  3. Imports CefSharp.WinForms
  4. Imports System.Runtime.InteropServices
  5. Imports System.Reflection
  6. Imports System.Security.Permissions
  7. Imports System.Threading
  8. Public Class Form1
  9. Public cefWeb As ChromiumWebBrowser
  10. Private fullnow As Boolean = False '标记当前窗体是否为全屏状态
  11. Private rect As New Rectangle '保存的全屏前的装提,退出全屏时恢复到此状况
  12. Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  13. 'Label2.BackColor = Color.FromArgb(0, Color.Transparent)
  14. Control.CheckForIllegalCrossThreadCalls = False
  15. 'Me.AllowTransparency = True
  16. 'Me.Opacity = 0
  17. 'Me.FormBorderStyle = FormBorderStyle.None
  18. 'Me.WindowState = FormWindowState.Maximized
  19. 'Me.Location = New Point(0, 0)
  20. 'Me.Size = SystemInformation.PrimaryMonitorSize
  21. 'SetFullScreen(False, rect)
  22. 'ChangeFullScreen()
  23. readTxt()
  24. 'HookKeyboard()
  25. ChangeFullScreen()
  26. 'Dim rec As Rectangle = Screen.PrimaryScreen.Bounds
  27. 'Me.Width = rec.Width
  28. 'Me.WindowState = FormWindowState.Maximized
  29. 'Me.Height = rec.Height
  30. 'Debug.Print("屏幕区域:")
  31. 'Me.FormBorderStyle = 0
  32. 'Me.TopMost = True
  33. Dim setting As CefSettings = New CefSettings()
  34. '设置可以跨域,不同源策略
  35. setting.CefCommandLineArgs.Add("--disable-web-security", "")
  36. Cef.Initialize(setting)
  37. CefSharpSettings.LegacyJavascriptBindingEnabled = True
  38. 'cefWeb = New ChromiumWebBrowser("https://zb.xmtyw.cn/medicine/intelligent-medicine-abinet/machine/index?deviceNum=14912202111000000600000000000000&VNK=7f55e28b")
  39. 'cefWeb = New ChromiumWebBrowser("http://192.168.131.111:8080/machine/index?deviceNum=14912202111000001000000000000000&VNK=4c8b6ff0")
  40. 'remoteUrl = "https://ehr.yihu.com/hlwyy/zjxl/healthMonitoring/demo/index.html"
  41. cefWeb = New ChromiumWebBrowser(remoteUrl)
  42. Dim ContextMenuHandlerB = New ContextMenuHandler()
  43. ContextMenuHandlerB.Form1Instance = Me
  44. cefWeb.MenuHandler = ContextMenuHandlerB
  45. Dim jsEvent = New JsEvent()
  46. jsEvent.Form1Instance = Me
  47. cefWeb.JavascriptObjectRepository.Register("jsApp", jsEvent, True)
  48. cefWeb.RenderProcessMessageHandler = New RenderProcessMessageHandler()
  49. cefWeb.LoadHandler = New LoadHandler()
  50. Me.Controls.Add(cefWeb)
  51. AddHandler cefWeb.Click, AddressOf CefClick
  52. Panel1.Visible = True
  53. Panel1.Visible = False
  54. End Sub
  55. '全屏切换
  56. Private Sub ChangeFullScreen()
  57. fullnow = Not fullnow
  58. 'Me.WindowState = FormWindowState.Normal '这一句是我自己加的,全屏最大化前恢复到默认状态(可能与我用的用户界面有关,不写也可以)
  59. 'SetFullScreen(fullnow, rect)
  60. If fullnow Then
  61. Me.FormBorderStyle = FormBorderStyle.None
  62. 'Me.ControlBox = False'还是与我用的界面控件有关
  63. Me.WindowState = FormWindowState.Maximized
  64. 'notify.ShowBalloonTip(2000, "注意", "应用正在以全屏模式运行。", ToolTipIcon.Info)
  65. Me.Location = New Point(0, 0)
  66. Me.Size = SystemInformation.PrimaryMonitorSize
  67. Else
  68. Me.FormBorderStyle = FormBorderStyle.Sizable
  69. 'Me.ControlBox = True
  70. Me.WindowState = FormWindowState.Normal
  71. End If
  72. End Sub
  73. '当窗体退出时检查全屏状态,如果是全屏则恢复(主要是任务栏)
  74. Private Sub Form1_FormClosed(sender As Object, e As FormClosedEventArgs) Handles Me.FormClosed
  75. If fullnow Then
  76. SetFullScreen(False, rect)
  77. End If
  78. End Sub
  79. Public Sub CheckShowPwd2()
  80. Dim t As Thread
  81. t = New Thread(AddressOf Me.CheckShowPwd1)
  82. t.Start()
  83. t.Join()
  84. End Sub
  85. Public Sub CheckShowPwd1()
  86. If fullnow Then
  87. Panel1.Visible = True
  88. Else
  89. pwd = ""
  90. Label1.Text = pwd
  91. ChangeFullScreen()
  92. End If
  93. End Sub
  94. Public KeyHandle As Integer
  95. Public CurTimes As Integer = 5
  96. Public NeedTimes As Integer = 15
  97. Public LastClickTime As Long = 0
  98. Public Function MouseHook(ByVal nCode As Long, _
  99. ByVal wParam As Long, _
  100. ByVal lParam As Long) As Long
  101. Dim clickTime As Long = Now.Ticks
  102. If wParam = WM_LBUTTONDOWN Then
  103. 'CheckShowPwd()
  104. LastClickTime = clickTime
  105. Debug.Print("左键单击down 坐标:")
  106. End If
  107. If wParam = WM_LBUTTONUP Then
  108. Dim diff As Long = clickTime - LastClickTime
  109. If clickTime - LastClickTime >= 50000000 Then
  110. If fullnow Then
  111. Panel1.Visible = True
  112. Else
  113. pwd = ""
  114. Label1.Text = pwd
  115. ChangeFullScreen()
  116. End If
  117. End If
  118. Debug.Print("左键单击 up 坐标:" & diff)
  119. End If
  120. Return CallNextHookEx(KeyHandle, nCode, wParam, lParam)
  121. End Function
  122. Public Sub CheckShowPwd(parameters As IContextMenuParams)
  123. If parameters.XCoord < 3000 Then
  124. If parameters.YCoord < 2000 Then
  125. Debug.Print(parameters.XCoord & "")
  126. Debug.Print(parameters.YCoord & "")
  127. Dim clickTime As Long = Now.Ticks
  128. Dim diff As Long = clickTime - LastClickTime
  129. If LastClickTime = 0 Then
  130. ElseIf clickTime - LastClickTime < 10000000 Then
  131. CurTimes -= 1
  132. If CurTimes = 0 Then
  133. CurTimes = NeedTimes
  134. If fullnow Then
  135. Panel1.Visible = True
  136. Else
  137. pwd = ""
  138. Label1.Text = pwd
  139. ChangeFullScreen()
  140. End If
  141. End If
  142. Else
  143. CurTimes = NeedTimes
  144. End If
  145. LastClickTime = clickTime
  146. Debug.Print("左键单击 坐标:" & clickTime & " : " & CurTimes & " : " & diff)
  147. Return
  148. End If
  149. End If
  150. CurTimes = NeedTimes
  151. End Sub
  152. Public Sub HookKeyboard()
  153. Dim hins As IntPtr = IntPtr.Zero
  154. hins = GetModuleHandle(Process.GetCurrentProcess.MainModule.ModuleName)
  155. KeyHandle = SetWindowsHookEx(WH_MOUSE_LL, AddressOf MouseHook, hins, 0)
  156. End Sub
  157. Public Sub UnhookKeyboard()
  158. Call UnhookWindowsHookEx(KeyHandle) '停止钩子
  159. End Sub
  160. Private Sub Label1_Click(sender As Object, e As EventArgs) Handles Label1.Click
  161. End Sub
  162. '确定按钮
  163. Private Sub Button7_Click(sender As Object, e As EventArgs) Handles Button7.Click
  164. If pwd = password Then
  165. Panel1.Visible = False
  166. ChangeFullScreen()
  167. End If
  168. End Sub
  169. '取消按钮
  170. Private Sub Button11_Click(sender As Object, e As EventArgs) Handles Button11.Click
  171. pwd = ""
  172. Label1.Text = ""
  173. Panel1.Visible = False
  174. End Sub
  175. Private Sub Panel1_Click(sender As Object, e As EventArgs) Handles Panel1.Click
  176. 'SendToBack()
  177. End Sub
  178. Private Sub Panel1_Paint(sender As Object, e As PaintEventArgs) Handles Panel1.Paint
  179. 'Panel1.BackColor = Color.Transparent
  180. 'AddHandler Button1.Click, AddressOf EnterPwd
  181. 'AddHandler Button2.Click, AddressOf EnterPwd
  182. 'AddHandler Button3.Click, AddressOf EnterPwd
  183. 'AddHandler Button4.Click, AddressOf EnterPwd
  184. 'AddHandler Button5.Click, AddressOf EnterPwd
  185. 'AddHandler Button6.Click, AddressOf EnterPwd
  186. 'AddHandler Button8.Click, AddressOf EnterPwd
  187. 'AddHandler Button9.Click, AddressOf EnterPwd
  188. 'AddHandler Button10.Click, AddressOf EnterPwd
  189. End Sub
  190. Dim pwd As String = ""
  191. Public Sub EnterPwd(sender As Object, e As EventArgs)
  192. pwd = pwd & sender.Text
  193. Label1.Text = pwd
  194. End Sub
  195. Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
  196. EnterPwd(sender, e)
  197. End Sub
  198. Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  199. EnterPwd(sender, e)
  200. End Sub
  201. Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
  202. EnterPwd(sender, e)
  203. End Sub
  204. Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
  205. EnterPwd(sender, e)
  206. End Sub
  207. Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
  208. EnterPwd(sender, e)
  209. End Sub
  210. Private Sub Button6_Click(sender As Object, e As EventArgs) Handles Button6.Click
  211. EnterPwd(sender, e)
  212. End Sub
  213. Private Sub Button10_Click(sender As Object, e As EventArgs) Handles Button10.Click
  214. EnterPwd(sender, e)
  215. End Sub
  216. Private Sub Button8_Click(sender As Object, e As EventArgs) Handles Button8.Click
  217. EnterPwd(sender, e)
  218. End Sub
  219. Private Sub Button9_Click(sender As Object, e As EventArgs) Handles Button9.Click
  220. EnterPwd(sender, e)
  221. End Sub
  222. Private Sub Button12_Click(sender As Object, e As EventArgs) Handles Button12.Click
  223. If pwd.Length > 0 Then
  224. pwd = pwd.Substring(0, pwd.Length - 1)
  225. Label1.Text = pwd
  226. End If
  227. End Sub
  228. Private Sub CefClick(sender As Object, e As EventArgs)
  229. Debug.Print("3333")
  230. End Sub
  231. Private Sub Form1_MouseClick(sender As Object, e As MouseEventArgs) Handles Me.MouseClick
  232. Debug.Print("222")
  233. End Sub
  234. Private Sub Label2_Click(sender As Object, e As EventArgs) Handles Label2.Click
  235. End Sub
  236. End Class
  237. Module TxtRead
  238. Public remoteUrl As String
  239. Public equNumFilePath As String
  240. Public password As String
  241. Public equNum As String
  242. Public clickTimes As String
  243. Public clickTime As String
  244. Public Function readTxt()
  245. Dim app As String = Assembly.GetAssembly(GetType(Form1)).Location
  246. Dim AssemPath As String = System.IO.Path.GetDirectoryName(app)
  247. 'Dim assem As Assembly = GetType(Form1).Assembly
  248. 'Dim AssemPath As String = assem.CodeBase
  249. Debug.Print("1111111:" & AssemPath)
  250. Dim arr
  251. Dim str
  252. Dim i As Long
  253. arr = Split(CreateObject("scripting.filesystemobject").opentextfile(AssemPath & "\config.txt").readall, vbNewLine)
  254. For i = 0 To UBound(arr)
  255. str = Split(arr(i), "=")
  256. If str(0) = "remoteUrl" Then
  257. remoteUrl = str(1)
  258. End If
  259. If str(0) = "equNumFilePath" Then
  260. equNumFilePath = str(1)
  261. End If
  262. If str(0) = "password" Then
  263. password = str(1)
  264. End If
  265. If str(0) = "clickTimes" Then
  266. clickTimes = str(1)
  267. End If
  268. If str(0) = "clickTime" Then
  269. clickTime = str(1)
  270. End If
  271. Next
  272. If clickTimes = "" Then
  273. clickTimes = 5
  274. End If
  275. If clickTime = "" Then
  276. clickTime = 2000
  277. End If
  278. If equNumFilePath <> "" Then
  279. arr = Split(CreateObject("scripting.filesystemobject").opentextfile(equNumFilePath).readall, vbNewLine)
  280. equNum = arr(0)
  281. If equNum <> "" Then
  282. If remoteUrl.IndexOf("?") <> -1 Then
  283. remoteUrl &= "&"
  284. Else
  285. remoteUrl &= "?"
  286. End If
  287. remoteUrl &= "deviceNum=" & equNum
  288. End If
  289. End If
  290. Debug.Print(remoteUrl)
  291. End Function
  292. End Module
  293. '全屏方法
  294. Module FullScreen
  295. Public Declare Auto Function FindWindow Lib "user32.dll" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
  296. Public Declare Auto Function ShowWindow Lib "user32.dll" (ByVal hwnd As Integer, ByVal nCmdShow As Integer) As Integer
  297. Public Declare Auto Function SystemParametersInfo Lib "user32.dll" (ByVal uAction As Integer, ByVal uParam As Integer, ByRef lpvParam As Rectangle, ByVal fuWinIni As Integer) As Integer
  298. Public Const SPIF_UPDATEINIFILE As Integer = &H1
  299. Public Const SPI_SETWORKAREA As Integer = 47
  300. Public Const SPI_GETWORKAREA As Integer = 48
  301. Public Const SW_SHOW As Integer = 5
  302. Public Const SW_HIDE As Integer = 0
  303. Public Function SetFullScreen(ByVal fullscreen As Boolean, ByRef rectOld As Rectangle) As Boolean
  304. Dim Hwnd As Integer = FindWindow("Shell_TrayWnd", Nothing)
  305. If Hwnd = 0 Then
  306. Return False
  307. End If
  308. If fullscreen Then
  309. ShowWindow(Hwnd, SW_HIDE)
  310. Dim rectFull As Rectangle = Screen.PrimaryScreen.Bounds
  311. SystemParametersInfo(SPI_GETWORKAREA, 0, rectOld, SPIF_UPDATEINIFILE) 'Get
  312. SystemParametersInfo(SPI_SETWORKAREA, 0, rectFull, SPIF_UPDATEINIFILE) 'Set
  313. Else
  314. ShowWindow(Hwnd, SW_SHOW)
  315. SystemParametersInfo(SPI_SETWORKAREA, 0, rectOld, SPIF_UPDATEINIFILE)
  316. End If
  317. Return True
  318. End Function
  319. End Module
  320. '鼠标钩子
  321. Module Module1
  322. <DllImport("User32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)>
  323. Public Function SetWindowsHookEx(ByVal idHook As Integer, ByVal HookProc As KeyHook, ByVal hInstance As IntPtr, ByVal wParam As Integer) As Integer
  324. End Function
  325. <DllImport("User32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)>
  326. Public Function CallNextHookEx(ByVal idHook As Integer, ByVal nCode As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As Integer
  327. End Function
  328. <DllImport("User32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)>
  329. Public Function UnhookWindowsHookEx(ByVal idHook As Integer) As Boolean
  330. End Function
  331. <DllImport("kernel32.dll", CharSet:=CharSet.Auto, CallingConvention:=CallingConvention.StdCall)>
  332. Public Function GetModuleHandle(ByVal name As String) As IntPtr
  333. End Function
  334. <StructLayout(LayoutKind.Sequential)>
  335. Public Structure KBDLLHOOKSTRUCT
  336. Public vkCode As Keys
  337. Public scanCode As Keys
  338. Public flags As Integer
  339. Public time As Integer
  340. Public dwExtraInfo As Integer
  341. End Structure
  342. Public Const HC_ACTION As Integer = 0
  343. Public Const WH_KEYBOARD_LL As Integer = 13
  344. Public Const WH_MOUSE_LL = 14
  345. Public Const WH_MOUSE = 7
  346. Public Const WM_LBUTTONUP = &H202
  347. Public Const WM_LBUTTONDOWN = &H201
  348. Public Delegate Function KeyHook(ByVal Code As Integer, ByVal wParam As Integer, ByVal lParam As IntPtr) As Integer
  349. '<MarshalAs(UnmanagedType.FunctionPtr)>
  350. Public callback As KeyHook
  351. End Module
  352. Public Class ContextMenuHandler
  353. Implements CefSharp.IContextMenuHandler
  354. Public Form1Instance
  355. Public Sub OnBeforeContextMenu1(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, parameters As IContextMenuParams, model As IMenuModel) Implements IContextMenuHandler.OnBeforeContextMenu
  356. 'Debug.Print(parameters.XCoord & "")
  357. 'Debug.Print(parameters.YCoord & "")
  358. Debug.Print("OnBeforeContextMenu1")
  359. 'Form1Instance.CheckShowPwd(parameters)
  360. 'model.Clear()
  361. End Sub
  362. Public Function OnContextMenuCommand1(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, parameters As IContextMenuParams, commandId As CefMenuCommand, eventFlags As CefEventFlags) As Boolean Implements IContextMenuHandler.OnContextMenuCommand
  363. Debug.Print("aa")
  364. Return False
  365. End Function
  366. Public Sub OnContextMenuDismissed1(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame) Implements IContextMenuHandler.OnContextMenuDismissed
  367. Debug.Print("cc")
  368. End Sub
  369. Public Function RunContextMenu1(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, parameters As IContextMenuParams, model As IMenuModel, callback As IRunContextMenuCallback) As Boolean Implements IContextMenuHandler.RunContextMenu
  370. Debug.Print("bbb")
  371. model.Clear()
  372. Return False
  373. End Function
  374. End Class
  375. Public Class RenderProcessMessageHandler
  376. Implements CefSharp.IRenderProcessMessageHandler
  377. Public Form1Instance
  378. Public Sub OnContextCreated(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame) Implements IRenderProcessMessageHandler.OnContextCreated
  379. 'chromiumWebBrowser.ExecuteScriptAsync("document.addEventListener('touchstart', function(){ window._touchstart_time = Date.now() }); document.addEventListener('touchend', function(){ if(Date.now() - window._touchstart_time > 5000) { jsApp.toggleFull() } })")
  380. chromiumWebBrowser.ExecuteScriptAsync("window._click_tiems = 0; window._click_time = 0; document.addEventListener('click', function(e){ if(e.clientY < 500 && e.clientX < 500){ console.log(window._click_tiems); if(window._click_tiems >= " & clickTimes & "){ window._click_tiems = 0; window._click_time = 0; jsApp.toggleFull(); return; } var cur = Date.now(); if(window._click_time){ if(cur - window._click_time < " & clickTime & "){ window._click_tiems++ } else { window._click_tiems = 0 } } else { window._click_tiems = 1 } window._click_time = cur;} else { window._click_tiems = 0; window._click_time = 0; } });")
  381. Debug.WriteLine("OnContextCreated")
  382. 'Debug.Print("OnContextCreated" & chromiumWebBrowser.CanExecuteJavascriptInMainFrame)
  383. End Sub
  384. Public Sub OnContextReleased(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame) Implements IRenderProcessMessageHandler.OnContextReleased
  385. 'Debug.Print("OnContextReleased" & chromiumWebBrowser.CanExecuteJavascriptInMainFrame)
  386. 'chromiumWebBrowser.ExecuteScriptAsync("window._click_tiems = 0; window._click_time = 0; document.addEventListener('click', function(e){ if(e.clientY < 500 && e.clientX < 500){ console.log(window._click_tiems); if(window._click_tiems >= " & clickTimes & "){ window._click_tiems = 0; window._click_time = 0; jsApp.toggleFull(); return; } var cur = Date.now(); if(window._click_time){ if(cur - window._click_time < " & clickTime & "){ window._click_tiems++ } else { window._click_tiems = 0 } } else { window._click_tiems = 1 } window._click_time = cur;} else { window._click_tiems = 0; window._click_time = 0; } });")
  387. Debug.WriteLine("OnContextReleased")
  388. End Sub
  389. Public Sub OnFocusedNodeChanged(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, node As IDomNode) Implements IRenderProcessMessageHandler.OnFocusedNodeChanged
  390. 'chromiumWebBrowser.ExecuteScriptAsync("window._click_tiems = 0; window._click_time = 0; document.addEventListener('click', function(e){ if(e.clientY < 500 && e.clientX < 500){ console.log(window._click_tiems); if(window._click_tiems >= " & clickTimes & "){ window._click_tiems = 0; window._click_time = 0; jsApp.toggleFull(); return; } var cur = Date.now(); if(window._click_time){ if(cur - window._click_time < " & clickTime & "){ window._click_tiems++ } else { window._click_tiems = 0 } } else { window._click_tiems = 1 } window._click_time = cur;} else { window._click_tiems = 0; window._click_time = 0; } });")
  391. Debug.WriteLine("OnFocusedNodeChanged")
  392. End Sub
  393. Public Sub OnUncaughtException(chromiumWebBrowser As IWebBrowser, browser As IBrowser, frame As IFrame, exception As JavascriptException) Implements IRenderProcessMessageHandler.OnUncaughtException
  394. 'chromiumWebBrowser.ExecuteScriptAsync("window._click_tiems = 0; window._click_time = 0; document.addEventListener('click', function(e){ if(e.clientY < 500 && e.clientX < 500){ console.log(window._click_tiems); if(window._click_tiems >= " & clickTimes & "){ window._click_tiems = 0; window._click_time = 0; jsApp.toggleFull(); return; } var cur = Date.now(); if(window._click_time){ if(cur - window._click_time < " & clickTime & "){ window._click_tiems++ } else { window._click_tiems = 0 } } else { window._click_tiems = 1 } window._click_time = cur;} else { window._click_tiems = 0; window._click_time = 0; } });")
  395. Debug.WriteLine("OnUncaughtException")
  396. End Sub
  397. End Class
  398. Public Class JsEvent
  399. Public Form1Instance
  400. Public Sub update()
  401. Shell("Update.exe")
  402. Debug.Print("444444")
  403. End Sub
  404. Public Sub toggleFull()
  405. Debug.Print("55555")
  406. 'Dim t As New Thread(AddressOf Form1Instance.CheckShowPwd1)
  407. 'Dim t As New Thread()
  408. 't.Start()
  409. 'Thread1.Invoke()
  410. 'Thread1.DynamicInvoke()
  411. 'Tasks.StrArg = "參数A" ' 设置用作參数的字段。
  412. 'Thread1.Start() ' 启动新线程。
  413. 'Thread1.Join() ' 等待线程 1 执行结束。
  414. Form1Instance.CheckShowPwd2()
  415. End Sub
  416. End Class
  417. Public Class LoadHandler
  418. Implements CefSharp.ILoadHandler
  419. Public Form1Instance
  420. Public Sub OnFrameLoadEnd(chromiumWebBrowser As IWebBrowser, frameLoadEndArgs As FrameLoadEndEventArgs) Implements ILoadHandler.OnFrameLoadEnd
  421. End Sub
  422. Public Sub OnFrameLoadStart(chromiumWebBrowser As IWebBrowser, frameLoadStartArgs As FrameLoadStartEventArgs) Implements ILoadHandler.OnFrameLoadStart
  423. Debug.WriteLine("OnFrameLoadStart")
  424. End Sub
  425. Public Sub OnLoadError(chromiumWebBrowser As IWebBrowser, loadErrorArgs As LoadErrorEventArgs) Implements ILoadHandler.OnLoadError
  426. Debug.WriteLine("OnLoadError")
  427. End Sub
  428. Public Sub OnLoadingStateChange(chromiumWebBrowser As IWebBrowser, loadingStateChangedArgs As LoadingStateChangedEventArgs) Implements ILoadHandler.OnLoadingStateChange
  429. Debug.WriteLine("OnLoadingStateChange: isLoading" & loadingStateChangedArgs.IsLoading)
  430. End Sub
  431. End Class