Why did the program pause?
Posted: Wed Jul 15, 2020 8:58 am
HI friends
我有一问题需向大家请教。当运行下面的程序时,如果在窗口上点击右键或右键点击notify icon 时,程序将不再继续运行,只有手动关闭窗口,程序才可继续运行。如何解决这个问题,请大家帮忙。
I have a question to ask you.When running the following program, if you right-click on window or notify icon , the program will no longer continue to run, and the program can only continue to run if the window is closed manually.How to solve this problem, please help.
我有一问题需向大家请教。当运行下面的程序时,如果在窗口上点击右键或右键点击notify icon 时,程序将不再继续运行,只有手动关闭窗口,程序才可继续运行。如何解决这个问题,请大家帮忙。
I have a question to ask you.When running the following program, if you right-click on window or notify icon , the program will no longer continue to run, and the program can only continue to run if the window is closed manually.How to solve this problem, please help.
Code: Select all
#include <hmg.ch>
Function Main()
SET DATE TO ANSI
SET CENTURY ON
SET MULTIPLE off
DEFINE WINDOW form_main AT 0 ,0 WIDTH 0 HEIGHT 0 ;
TITLE "" ICON NIL ;
MAIN noshow ;
ON INIT start() ;
NOTIFYICON "NETW0028" NOTIFYTOOLTIP "Test and notify menu" ;
ON NOTIFYCLICK nil
DEFINE NOTIFY MENU
ITEM 'About' ACTION msginfo("hello!")
SEPARATOR
ITEM "Exit" ACTION THISWINDOW.RELEASE
END MENU
END WINDOW
form_main.Center
form_main.Activate
Return NIL
function start()
local oWEB
form_main.HIDE
oWEB:=dss_web_http():NEW()
form_main.release
return
#include "hbclass.ch"
class dss_web_http
var oObj init nil
method new()
end class
method new() class dss_web_http
local i:=1
for i:=1 to 5
::oObj:=jyfx_MK_IMAGE():new()
::oObj:http_view()
next
return self
CLASS jyfx_MK_IMAGE
method new()
method http_view()
endclass
method new() class jyfx_MK_IMAGE
LOCAL cString:=""
LOCAL oHtmlDoc:=nil
cString+= "<p>Please right-click on the window or click the notify icon in the lower right corner,"
cString+="the window will no longer close automatically,"
cString+="Only when the window is closed manually,the program can continue to run. Why?How to avoid it? <p>"
oHtmlDoc := THtmlDocument():new( cString )
oHtmlDoc:writeFile( "TEMP.html" )
return self
method http_view() class jyfx_MK_IMAGE
local oObject
local filename
DEFINE WINDOW Win1 ;
WIDTH 1360 ;
HEIGHT 768 ;
TITLE 'View' ;
MODAL
DEFINE ACTIVEX Test
ROW 0
COL 0
WIDTH 1360
HEIGHT 768
PROGID "shell.explorer.2"
END ACTIVEX
DEFINE TIMER Timer_1 INTERVAL 1500 ACTION (this.enabled:=.f.,thiswindow.release)
END WINDOW
oObject := GetProperty('Win1','Test','Object')
filename:="file:///"+getcurrentfolder()+"/"+"temp.html"
oObject:Navigate(filename)
Win1.Center
Win1.Activate
RETURN nil