Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to insert html code into QM code and run function in JS code of the html
#1
I want to insert the html code into the QM code , so that QM can run the web page just by generating an exe file, but I don't know if it can be implemented.

In addition, when the web page is opened, the function fullScreen() in the JS code of the html can be automatically run, so that I can achieve full-screen display effect.

I hope someone can help me, any suggestions and comments are welcome, thanks in advance   Smile

html code: 

Code:
Select All      Help
<html>
   <head>
       <title>test</title>
       <style type="text/css" media="screen">
           html, body  { height:100%;width:100% }
           body { margin:0; padding:0; overflow:hidden; text-align:center;
                  background-color: #ffffff; }  
       </style>
   </head>
   <body>
       <button onclick="fullScreen()">Full screen</button>
       <button onclick="exitScreen()">Exit Full Screen</button>
       
       <iframe style="width:100%;height:100%" src="http://fs.focusky.com.cn/jhgh/glyv/index.html" seamless="seamless" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" ></iframe>
   </body>

   <script type="text/javascript">
       //full screen
       function fullScreen(){
           var el = document.documentElement;
           var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;      
               if(typeof rfs != "undefined" && rfs) {
                   rfs.call(el);
               };
             return;
       }
       //Exit Full Screen
       function exitScreen(){
           if (document.exitFullscreen) {  
               document.exitFullscreen();  
           }  
           else if (document.mozCancelFullScreen) {  
               document.mozCancelFullScreen();  
           }  
           else if (document.webkitCancelFullScreen) {  
               document.webkitCancelFullScreen();  
           }  
           else if (document.msExitFullscreen) {  
               document.msExitFullscreen();  
           }
           if(typeof cfs != "undefined" && cfs) {
               cfs.call(el);
           }
       }

   </script>
</html>
#2
The following code can display the full-screen button in the web page, but cannot display the web page. In addition, how to run the full-screen JS function in the web page after displaying the web? Huh



Macro Macro6
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 374 232 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 374 232 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD=
;<html>
;;;;<head>
;;;;;;;;<title>test</title>
;;;;;;;;<style type="text/css" media="screen">
;;;;;;;;;;;;html, body  { height:100%;width:100% }
;;;;;;;;;;;;body { margin:0; padding:0; overflow:hidden; text-align:center;
;;;;;;;;;;;;;;;;;;;background-color: #ffffff; }
;;;;;;;;</style>
;;;;</head>
;;;;<body>
;;;;;;;;<button onclick="fullScreen()">Full screen</button>
;;;;;;;;<button onclick="exitScreen()">Exit Full Screen</button>
;;;;;;;;
;;;;;;;;<iframe style="width:100%;height:100%" src="http://fs.focusky.com.cn/jhgh/glyv/index.html" seamless="seamless" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" ></iframe>
;;;;</body>
;
;;;;<script type="text/javascript">
;;;;;;;;//full screen
;;;;;;;;function fullScreen(){
;;;;;;;;;;;;var el = document.documentElement;
;;;;;;;;;;;;var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;
;;;;;;;;;;;;;;;;if(typeof rfs != "undefined" && rfs) {
;;;;;;;;;;;;;;;;;;;;rfs.call(el);
;;;;;;;;;;;;;;;;};
;;;;;;;;;;;;;;return;
;;;;;;;;}
;;;;;;;;//Exit Full Screen
;;;;;;;;function exitScreen(){
;;;;;;;;;;;;if (document.exitFullscreen) {
;;;;;;;;;;;;;;;;document.exitFullscreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;else if (document.mozCancelFullScreen) {
;;;;;;;;;;;;;;;;document.mozCancelFullScreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;else if (document.webkitCancelFullScreen) {
;;;;;;;;;;;;;;;;document.webkitCancelFullScreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;else if (document.msExitFullscreen) {
;;;;;;;;;;;;;;;;document.msExitFullscreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;if(typeof cfs != "undefined" && cfs) {
;;;;;;;;;;;;;;;;cfs.call(el);
;;;;;;;;;;;;}
;;;;;;;;}
;
;;;;</script>
;</html>

if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,DT_SetAutoSizeControls(hDlg "3s")
,max hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1

Click the full screen button, it can not display the full screen of the webpage, but directly open the HTML file with IE browser, click the button is full screen   Huh

The following web page file can be opened normally in Internet Explorer 11. I can also click the full screen button to make the web page full screen display.


Attached Files Image(s)
   

.html   web.html (Size: 1.71 KB / Downloads: 28)
#3
Need this most likely to open page



Web browser control - disable IE7 emulation

but keep in mind your javascript fullscreen function will not work because the control is contained inside a dialog
#4
Still can't show content in webpages, only two buttons are displayed Huh



Macro Macro5
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 374 232 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 374 232 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD=
;<html>
;;;;<head>
;;;;;;;;<title>test</title>
;;;;;;;;<style type="text/css" media="screen">
;;;;;;;;;;;;html, body  { height:100%;width:100% }
;;;;;;;;;;;;body { margin:0; padding:0; overflow:hidden; text-align:center;
;;;;;;;;;;;;;;;;;;;background-color: #ffffff; }
;;;;;;;;</style>
;;;;</head>
;;;;<body>
;;;;;;;;<button onclick="fullScreen()">Full screen</button>
;;;;;;;;<button onclick="exitScreen()">Exit Full Screen</button>
;;;;;;;;
;;;;;;;;<iframe style="width:100%;height:100%" src="http://fs.focusky.com.cn/jhgh/glyv/index.html" seamless="seamless" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" ></iframe>
;;;;</body>
;
;;;;<script type="text/javascript">
;;;;;;;;//full screen
;;;;;;;;function fullScreen(){
;;;;;;;;;;;;var el = document.documentElement;
;;;;;;;;;;;;var rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullscreen;
;;;;;;;;;;;;;;;;if(typeof rfs != "undefined" && rfs) {
;;;;;;;;;;;;;;;;;;;;rfs.call(el);
;;;;;;;;;;;;;;;;};
;;;;;;;;;;;;;;return;
;;;;;;;;}
;;;;;;;;//Exit Full Screen
;;;;;;;;function exitScreen(){
;;;;;;;;;;;;if (document.exitFullscreen) {
;;;;;;;;;;;;;;;;document.exitFullscreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;else if (document.mozCancelFullScreen) {
;;;;;;;;;;;;;;;;document.mozCancelFullScreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;else if (document.webkitCancelFullScreen) {
;;;;;;;;;;;;;;;;document.webkitCancelFullScreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;else if (document.msExitFullscreen) {
;;;;;;;;;;;;;;;;document.msExitFullscreen();
;;;;;;;;;;;;}
;;;;;;;;;;;;if(typeof cfs != "undefined" && cfs) {
;;;;;;;;;;;;;;;;cfs.call(el);
;;;;;;;;;;;;}
;;;;;;;;}
;
;;;;</script>
;</html>
WebBrowserControlDisableIE7Emulation
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,DT_SetAutoSizeControls(hDlg "3s")
,max hDlg
,
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1
;BEGIN PROJECT
;main_function  Macro5
;exe_file  $my qm$\Macro5.exe
;icon  <default>
;manifest  $qm$\default.exe.manifest
;flags  6
;guid  {DDF3C421-2C99-4686-99B5-02F5CD7E2DD3}
;END PROJECT
#5
below i have shown how to have a button for full screen and also how to load with and without the iframe
don't really need the iframe at all
the javascript was never going to work 

Function Fullscreen
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90CF0AC8 0x0 0 0 374 232 "Dialog"
;4 Button 0x54032000 0x0 0 0 80 14 "Full screen (F11)"
;3 ActiveX  0x54030000 0x0 0 0 374 232 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD="http://fs.focusky.com.cn/jhgh/glyv/index.html";;;without iframe
;to use iframe uncomment line below and comment line above and  find we3.Refresh line(line 40 and uncomment)
;str ax3SHD=
;<html>
;;;;<head>
;;;;;;;;<title>test</title>
;;;;;;;;<style type="text/css" media="screen">
;;;;;;;;;;;;html, body  { height:100%;width:100% }
;;;;;;;;;;;;body { margin:0; padding:0; overflow:hidden; text-align:center;
;;;;;;;;;;;;;;;;;;;background-color: #ffffff; }
;;;;;;;;</style>
;;;;</head>
;;;;<body>
;;;;;;;;<iframe style="width:100%;height:100%" src="http://fs.focusky.com.cn/jhgh/glyv/index.html" seamless="seamless" scrolling="no" frameborder="0" allowtransparency="true" allowfullscreen="true" ></iframe>
;;;;</body>
;</html>
WebBrowserControlDisableIE7Emulation

if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,SHDocVw.WebBrowser we3
,we3._getcontrol(id(3 hDlg))
,DT_SetAutoSizeControls hDlg "3s"
,DT_SetAccelerators hDlg "4 F11"
,;we3.Refresh;;; uncomment  if using iframe but dont really need iframe
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
,case 4
,int-- t_full; t_full=!t_full
,int cWC=id(3 hDlg)
,int fsb= id(4 hDlg)
,sub.FullScreen hDlg t_full cWC fsb    
ret 1
#sub FullScreen
function w full cwc fullscreenButton
str text
if full
,,SetWinStyle w WS_BORDER|WS_THICKFRAME 2
,,SetWindowState w SW_SHOWMAXIMIZED 1
,,text="Exit Full Screen (F11)"
,,;SetWindowState cwc SW_SHOWMAXIMIZED 1
,,InvalidateRect child("" "Internet Explorer_Server" cwc) 0 0 
else
,,SetWinStyle w WS_BORDER|WS_THICKFRAME 1
,,SetWindowState w SW_SHOWNORMAL 1
,,text="Full screen (F11)"
,,;SetWindowState cwc SW_SHOWNORMAL 1
,,InvalidateRect child("" "Internet Explorer_Server" cwc) 0 0 
text.setwintext(fullscreenButton)
#6
It seems that there is more than one way to solve the problem. I learned a lot from the code.

thank you very much. Heart


Forum Jump:


Users browsing this thread: 1 Guest(s)