Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to redefine the function of hotkeys
#1
I have been plagued by two problems.

I created a dialog and embedded IE browser, after opening the webpage,

1) When I press F11, a full screen prompt appears, I need to click the allow button  (pic1.png)


2) In full screen mode, when my mouse pointer moves to the top of the desktop, an exit prompt will appear (pic2.png)

How to redefine the function of the F11 button? To solve the above two problems: do not need to click the allow button, does not appear to exit the prompt, I tried to scan the allow button, but in different language operating systems, allowing the text above the button is different, in addition, different Screen resolution, the size of the button is not the same

I Hope someone can help me solve this problem, any suggestions and comments are welcome, thanks in advance  Heart

In addition: use the method of changing the appearance of the dialog box: hide the title bar, maximize, although I can solve the above problem, but many of Flash's own shortcut keys will be invalid, only in the case of clicking the allow button, they can use normally

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

str controls = "3"
str ax3SHD
ax3SHD="http://fs.focusky.com.cn/ekeec/saea/index.html?flash"
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,case IDCANCEL
ret 1


Attached Files Image(s)
       
#2
Press F1 to full screen, but some hot keys are not available, for example: ctrl+K (auto play), ctrl+P (check thumbnail)…… Confused

Press F11 can also full screen, hotkey use is normal, but the operation is not convenient, I hope someone can provide some suggestions, thanks Heart

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

str controls = "3"
str ax3SHD
ax3SHD="http://fs.focusky.com.cn/ekeec/saea/index.html?flash"
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 "401 F1" ;;Press F1 to full screen, but some hot keys are disabled, for example: ctrl+K (auto play), ctrl+P (check thumbnail)
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case 401
,if max(hDlg)
,,SetWinStyle hDlg WS_CAPTION 1
,,SetWinStyle hDlg WS_BORDER 1
,,res hDlg
,else
,,SetWinStyle hDlg WS_CAPTION 2
,,SetWinStyle hDlg WS_BORDER 2
,,max hDlg
,case IDOK
,case IDCANCEL
ret 1
#3
Ctr+p and ctrl+k only work when flash control is fullscreen not dialog window
try this
works for me 
F11 for fullscreen flash 
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 444 242 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 444 242 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="http://fs.focusky.com.cn/ekeec/saea/index.html?flash"
WebBrowserControlDisableIE7Emulation
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,mac "WaitForImage"
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,SetProp(hDlg "running" 0)
,case IDCANCEL
,SetProp(hDlg "running" 0)
ret 1
Function WaitForImage
Code:
Select All      Help
spe -1
int w2=win("Dialog" "#32770")
SetProp(w2 "running" 1)
,rep
,,if(!GetProp(w2 "running"))end
,,rep
,,,wait(0.4 WC win("" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,int w=win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen")
,,rep
,,,wait 0.4 S "image:h1763C271" w 0 1|16|0x400
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,lef
,,rep
,,,wait(0.4 -WC win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break
will need this file
   
on qm main window 
click WaitForImage  fuction on left 
   
then Press alt+F6
will open resources dialog
on resources window
select WaitForImage on left side then on right side click add then import from file
select the image the click open then on next window click ok
then image should be available  to use

will click allow button
other prompt can't do anything with i
#4
Thank you very much. Heart   I tested it on my screen (1366*768) and it works fine.

I have a question: Does it take up too much resources to use the way to wait for images?

Can you define a hot key, for example: F10, after pressing F10, it will execute F11 + scan the picture + click the picture action ? Smile

Sometimes unsuccessful, the prompt will still be displayed  Huh

The above code takes effect when it is executed for the first time. After exiting the full screen, it will be executed again and it will not take effect.
#5
The way i have it setup shouldn't use much resources  only scans  once and only  when flash fullscreen control  is created  after it finds  the image it waits  till  that window  is destroyed  then starts loop back waiting  for full screen control being created. Function  stops automatically when main dialog  window is closed .

try this

Function WaitForImage
Code:
Select All      Help
spe -1
int w2=win("Dialog" "#32770")
SetProp(w2 "running" 1)
POINT _m; xm _m ;;save mouse position in _m
,rep
,,if(!GetProp(w2 "running"))end
,,rep
,,,wait(0.4 WC win("" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,int w=win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen")
,,rep
,,,wait 0.4 S "image:h1763C271" w 0 1|16|0x400
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,lef
,,rep
,,,wait(0.4 -WC win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,mou _m.x _m.y
#6
I generated an exe file for testing and found that the work is unstable and often cannot automatically click the allow button

When F10 is pressed, Executable:( F11 + Scan + Click ) be more stable?
#7
no it wont be any more stable try again  with updated WaitForImage function. the problem your having is cause the mouse isn't moved and your probably pressing F11 then esc then F11 again try it again with updated function

Function WaitForImage
Code:
Select All      Help
spe -1
int w2=win("Dialog" "#32770")
SetProp(w2 "running" 1)
POINT _m; xm _m ;;save mouse position in _m
,rep
,,if(!GetProp(w2 "running"))end
,,rep
,,,wait(0.4 WC win("" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,int w=win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen")
,,rep
,,,wait 0.4 S "image:h1763C271" w 0 1|16|0x400
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,lef
,,rep
,,,wait(0.4 -WC win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,mou _m.x _m.y
#8
Test the above code, found no problem, but the second press esc will close the dialog box, how do not close the window?

It would be great if we could redefine F11  Tongue

When I press F11, it will be full screen, then scan the image and finally click on the image

——————————————————————————————————————————————

Is there any way to control the mouse and do not move it to the top of the screen?

Because there will be an exit prompt of about 5 seconds, it would be very bad if it happened during the demonstration. Confused
#9
You dont understand how the flash file works. as far as i know cant change flash behavior. the dialog closing is because of hotkey assigned to cancel 

change case IDCANCEL
to this
Code:
Select All      Help
,case IDCANCEL
,ifk(Z)          ;; Esc
,,ret 0
,SetProp(hDlg "running" 0)

try this moves mouse to center of window

Function WaitForImage
Code:
Select All      Help
spe -1
int w2=win("Dialog" "#32770")
SetProp(w2 "running" 1)
mou 0.5 0.5 w2 1

POINT _m; xm _m ;;save mouse position in _m
,rep
,,if(!GetProp(w2 "running"))end
,,rep
,,,wait(0.4 WC win("" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,int w=win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen")
,,rep
,,,wait 0.4 S "image:h1763C271" w 0 1|16|0x400
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,lef
,,rep
,,,wait(0.4 -WC win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(w2 "running"))end
,,,,continue
,,,break    
,,mou _m.x _m.y
#10
The high version of flash player will have this annoying full-screen prompts, low version does not have, there is no way to register the lower version of the flash player?  Huh

Using the above code, the exit prompt still appears when the mouse pointer moves to the top edge of the screen  Confused
#11
the prompts are built into the flash file can't remove them all you can do is avoid the top when in fullscreen mode. Hence why i move the mouse to center of window. Its  just the way flash works. ALL you can do is keep the mouse away from the top of the fullscreen flash control
#12
You are right, the following method can be full screen, but the flash hotkey can not be used

For the time being, this can only be done, thanks again for your help


   Smile

___________________________________________________
,case 401
,if max(hDlg)
,,SetWinStyle hDlg WS_CAPTION 1
,,SetWinStyle hDlg WS_BORDER 1
,,res hDlg
,else
,,SetWinStyle hDlg WS_CAPTION 2
,,SetWinStyle hDlg WS_BORDER 2
,,max hDlg
#13
@kevin

I want to achieve when the Flash is loaded, automatically press F11, and click the allow button, how to determine whether the Flash is loaded?
#14
maybe this may work for this file only
will need this file

   

will need to add to resources of  WaitForLoadImage 
on qm main window 

click WaitForLoadImage  fuction on left 
      
then Press alt+F6
will open resources dialog
on resources window
select WaitForLoadImage on left side then on right side click add then import from file
select the image the click open then on next window click ok
then image should be available  to use
Function DialogFlashInWebBrowserControl 
Code:
Select All      Help
str dd=
;BEGIN DIALOG
;0 "" 0x90C80AC8 0x0 0 0 444 242 "Dialog"
;3 ActiveX 0x54030000 0x0 0 0 444 242 "SHDocVw.WebBrowser {8856F961-340A-11D0-A96B-00C04FD705A2}"
;END DIALOG
;DIALOG EDITOR: "" 0x2040700 "*" "" "" ""

str controls = "3"
str ax3SHD
ax3SHD="http://fs.focusky.com.cn/ekeec/saea/index.html?flash"
WebBrowserControlDisableIE7Emulation
if(!ShowDialog(dd &sub.DlgProc &controls)) ret


#sub DlgProc
function# hDlg message wParam lParam

sel message
,case WM_INITDIALOG
,mac "WaitForLoadImage" "" hDlg
,mac "WaitForImage" "" hDlg
,case WM_DESTROY
,case WM_COMMAND goto messages2
ret
;messages2
sel wParam
,case IDOK
,SetProp(hDlg "running" 0)
,case IDCANCEL
,ifk(Z)          ;; Esc
,,ret 0
,SetProp(hDlg "running" 0)
ret 1
Function WaitForLoadImage
Code:
Select All      Help
function hwnd
spe -2
int w1=wait(0 WC child("" "MacromediaFlashPlayerActiveX" hwnd))
wait 0 S "image:hE7C04345" hwnd 0 1|16|0x400
0.2
key F11

Function WaitForImage
Code:
Select All      Help
function hwnd
spe -2
SetProp(hwnd "running" 1)
mou 0.5 0.5 hwnd 1
POINT _m; xm _m ;;save mouse position in _m
,rep
,,if(!GetProp(hwnd "running"))end
,,rep
,,,wait(0.4 WC win("" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(hwnd "running"))end
,,,,continue
,,,break    
,,int w=win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen")
,,rep
,,,wait 0.4 S "image:h1763C271" w 0 1|16|0x400
,,,err
,,,,if(!GetProp(hwnd "running"))end
,,,,continue
,,,break    
,,lef
,,0.3
,,mou _m.x _m.y
,,rep
,,,wait(0.4 -WC win("loading - Adobe Flash Player" "ShockwaveFlashFullScreen"))
,,,err
,,,,if(!GetProp(hwnd "running"))end
,,,,continue
,,,break
#15
Unsuccessful, prompt window not found, Intermittent Caton Huh

This method, when I change the webpage address, need to re-scan the picture, some trouble  Confused


Attached Files Image(s)
   
#16
there isnt an easy way to know when flash file is fully loaded. 
Unless you program the flash file yourself, then can set some indicator or property that could be possibly gotten.
It's just the nature of flash
But as i posted would only work for that url and that flash file.
Flash is not easily automated from external programs. much work and not always consistent.
each flash file is different.
#17
Anyway, thank you very much for your zealous help  Heart

Is there a simple way to implement button mapping?   Smile

E.g,

1) When I press the tab key, execute F11, press the tab key will be more convenient

2) When I press alt+k, execute ctrl+k

I know the following method, The tab is in effect, but alt+k does not work. What is the reason? Huh

DT_SetAccelerators hDlg "401 T[]402 Ak"

case 401
key F11
case 402
key Ck


Forum Jump:


Users browsing this thread: 1 Guest(s)