It is possible to run keyboard keys in Activex

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
PepeViyuela
Posts: 30
Joined: 06 Sep 2022, 12:04

It is possible to run keyboard keys in Activex

04 Jun 2024, 01:31

It is possible to run keyboard keys in Activex
For example by selecting a file and type key delete remove the file
Thank you

Code: Select all

#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
;<=============================================>
e1x:=""
e1x=
(Ltrim join|
%A_Desktop%\
)
;<=============================================>
Gui Add, ActiveX, vWB x8 y64 w370 h451 , Shell.Explorer
Gui Add, ComboBox, gPath vRoute x8 y32 w257,  %e1x%||
Gui Add, Text, x8 y8 w42 h23 , Path:

Gui Show, x43 y444 w437 h554, Activex

Goto, Path
Return

;<=============Path========================>
Path:
Gui, Submit, NoHide
WB.Navigate(Route)  ; This is specific to the web browser control.
Return
;<=============================================>
GuiEscape:
GuiClose:
    ExitApp
garry
Posts: 3840
Joined: 22 Dec 2013, 12:50

Re: It is possible to run keyboard keys in Activex

04 Jun 2024, 13:49

an example with key DEL

Code: Select all

#SingleInstance Force
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
;<=============================================>
e1x:=""
e1x=
(Ltrim join|
%A_Desktop%\
)
;<=============================================>
Gui, 1:+HwndGuiID
Gui Add, ActiveX, vWB x8 y64 w370 h451 , Shell.Explorer
Gui Add, ComboBox, gPath vRoute x8 y32 w257,  %e1x%||
Gui Add, Text, x8 y8 w42 h23 , Path:
Gui Show, x43 y444 w437 h554, Activex
Goto, Path
Return
;<=============Path========================>
Path:
Gui, Submit, NoHide
WB.Navigate(Route)  ; This is specific to the web browser control.
Return
;<=============================================>
GuiEscape:
GuiClose:
ExitApp
;-----------------------------------------------
#If WinActive("ahk_id " GuiID)
del::
Gui, submit,nohide
sel := wb.Document.SelectedItems
for item in sel
 {
 aa:=item.path
 FileGetAttrib,var,%aa%
 msgbox, 262180,RECYCLE ,Want you really recyle ?`n%aa% 
 ifmsgbox,NO
     return
 ;if (var="D")
 ;  {
 ;  fileremovedir,%aa%         ;- Removes the directory, but only if it is empty.
 ;  fileremovedir,%aa%,1       ;- Removes the directory including its files and subdirectories.
 ;  }
 ;else
   filerecycle,%aa%            ;- recycle file or folder
 }
return
#if
;=================================================
PepeViyuela
Posts: 30
Joined: 06 Sep 2022, 12:04

Re: It is possible to run keyboard keys in Activex

04 Jun 2024, 16:21

Excellent thank you very much garry.

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Descolada, Spawnova and 66 guests