ShadowElf
Active Members-
Posts
65 -
Joined
-
Last visited
ShadowElf's Achievements
Wayfarer (2/7)
0
Reputation
-
sorry, I just find the problem... one hour for searchng... then forum... then the ideea. FileWrite ( @ScriptDir & "\verifica.txt", $CmdLine[1] ) when I execute if from another program... it make txt file to wrong folder... that's the problem
-
I have a strange situation... Windows 7 64 my very small script #include <Constants.au3> #include <FileConstants.au3> If $CmdLine[0] > 0 Then FileDelete ( "verifica.txt" ) FileWrite ( "verifica.txt", $CmdLine[1] ) MsgBox(0, "Done", $CmdLine[1]) EndIf when I run it fom command line: " abcd.exe asd_asd " IT create a file and write to it asd_asd. If I start this mini exe with another program... it does not create the file. but alert with parameter (msgbox)... but file is not created.... any ideea? thanks I have checked "run as administrator" ... no succes
-
number of copy can be sent to the printer? #include 'printMGv2.au3' Global $hp Local $mmssgg,$marginx,$marginy $hp = _PrintDllStart($mmssgg);this must always be called first if $hp = 0 then consolewrite("Error from dllstart = " & $mmssgg & @CRLF) Exit endif $newselect = _PrintSelectPrinter($hp, "AAXXCCC") ; $newselect = _PrintSelectNUMBER OF COPY ($hp, "30") ?????????????? _PrintPageOrientation($hp,1);landscape _PrintSetDocTitle($hp,"This is a test page for PDFcreator No. 01") _PrintStartPrint($hp) _PrintImage($hp,"test-0.jpg",1,1,400,400) _PrintEndPrint($hp) _PrintNewPage($hp); _printDllClose($hp)
-
thanks DaleHohm but I realy need an working example. I have read documentation but it is a little over my skill. what I try #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() $postaskbar = _GetTaskBarPos() ; open gui relative to taskbar height $inaltime=@DesktopHeight-(@DesktopHeight-$postaskbar[2])-30 ; height of gui Local $oIE = _IECreateEmbedded() GUICreate("XXX", @DesktopWidth, $inaltime, 0 , 0 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 20, @DesktopWidth-24, $inaltime-30) GUISetState() ;Show GUI _IENavigate($oIE, "http://www.autoitscript.com") $oIEEvents = ObjEvent($oIE, "alertt_") ; Waiting for user to close the window While 1 _IEHeadInsertEventScript($oIE, "logo", "onclick", "alert('Someone clicked the document!'); return false;") _IEHeadInsertEventScript($oIE, "document", "oncontextmenu", "return false;") $oIEEvents = ObjEvent($oIE, "alertt_") Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit ;function to get taskbar size Func _GetTaskBarPos() Global Const $ABM_GETTASKBARPOS = 0x5 $h_taskbar = WinGetHandle("","Start") $AppBarData = DllStructCreate("dword;int;uint;uint;int;int;int;int;int") DllStructSetData($AppBarData,1,DllStructGetSize($AppBarData)) DllStructSetData($AppBarData,2,$h_taskbar) $lResult = DllCall("shell32.dll","int","SHAppBarMessage","int",$ABM_GETTASKBARPOS,"ptr",DllStructGetPtr($AppBarData)) If Not @error Then If $lResult[0] Then Return StringSplit(DllStructGetData($AppBarData,5) & "|" & _ DllStructGetData($AppBarData,6) & "|" & DllStructGetData($AppBarData,7) & "|" & _ DllStructGetData($AppBarData,8),"|") EndIf EndIf SetError(1) Return 0 EndFunc Func alertt_alert() MsgBox(4096, "demo", "demo", 10) EndFunc
-
Hy all I try to make a web aplication with some "desktop" function basicaly are a web aplication, but when a link (button, image, etc) with a ID is clicked, to execute autoit function for example... in webpage www.autoitscript.com there is logo div with id="logo". I want when I click div logo to execute autoit function I have tried with _IEHeadInsertEventScript($oIE, "document", "onclick", "alert('Someone clicked the document!');") but it is an javascript alert and if it leaves the first page... the "alert" dissapear here is my code #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> _IEErrorHandlerRegister() $postaskbar = _GetTaskBarPos() ; open gui relative to taskbar height $inaltime=@DesktopHeight-(@DesktopHeight-$postaskbar[2])-30 ; height of gui Local $oIE = _IECreateEmbedded() GUICreate("XXX", @DesktopWidth, $inaltime, 0 , 0 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) GUICtrlCreateObj($oIE, 10, 20, @DesktopWidth-24, $inaltime-30) GUISetState() ;Show GUI _IENavigate($oIE, "http://www.autoitscript.com") _IEHeadInsertEventScript($oIE, "document", "onclick", "alert('Someone clicked the document!');") ; Waiting for user to close the window While 1 Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit ;function to get taskbar size Func _GetTaskBarPos() Global Const $ABM_GETTASKBARPOS = 0x5 $h_taskbar = WinGetHandle("","Start") $AppBarData = DllStructCreate("dword;int;uint;uint;int;int;int;int;int") DllStructSetData($AppBarData,1,DllStructGetSize($AppBarData)) DllStructSetData($AppBarData,2,$h_taskbar) $lResult = DllCall("shell32.dll","int","SHAppBarMessage","int",$ABM_GETTASKBARPOS,"ptr",DllStructGetPtr($AppBarData)) If Not @error Then If $lResult[0] Then Return StringSplit(DllStructGetData($AppBarData,5) & "|" & _ DllStructGetData($AppBarData,6) & "|" & DllStructGetData($AppBarData,7) & "|" & _ DllStructGetData($AppBarData,8),"|") EndIf EndIf SetError(1) Return 0 EndFunc thanks a lot for any help UPDATE i put _IEHeadInsertEventScript($oIE, "logo", "onclick", "alert('Someone clicked the document!');") in loop and now I can navigate in site and onclick function is executed... but it is a javascript code... I want autoit function to be executed While 1 _IEHeadInsertEventScript($oIE, "logo", "onclick", "alert('Someone clicked the document!');") Local $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd
-
Hi all is there any way to listen on 2 com ports in she same time? I want to listen 2 modems if any of them rings
- 680 replies
-
- binary data
- com port
-
(and 2 more)
Tagged with:
-
Lost control after _IECreateEmbedded
ShadowElf replied to ShadowElf's topic in AutoIt General Help and Support
problem fixed _IENavigate($IE, $urlll2, 0) thx -
Can I use Windows Printing SDK from here? To print with EP 50 and using dll from there? http://www.datecs.bg/products.php?cat=2&prod_id=13 if yes... how? pls an example
-
Lost control after _IECreateEmbedded
ShadowElf replied to ShadowElf's topic in AutoIt General Help and Support
I posted a bigger part of the code, pls help. I don't understannd the help from PsaltyDS (sorry) Func genereazalistafurnizori is apelated from a file menu Func genereazalistafurnizori() Global $Formlistafurnizori,$ffnume,$ffro,$ffj,$fflocalitate,$ffadresa,$ffjudet,$ffcapsoc1,$ffcapsoc2,$ffpunctlucru,$ffperscontact,$fftel Global $fffax,$ffmail,$ffurl,$ffbanca1,$ffbanca2,$ffbanca3,$afnume,$afro,$afj,$aflocalitate,$afadresa,$afjudet,$afcapsocial,$afpunctlucru Global $afperscontact,$aftelefon,$aftelefon,$affax,$afmail,$afurl,$afcont1,$afcont2,$afcont3,$afbanca1,$afbanca2,$afbanca3, $ffexclusiv $Formlistafurnizori = GUICreate("Generare lista furnizori", 686, 470, 195, 140) $Group1 = GUICtrlCreateGroup("Filtre", 16, 24, 649, 201) GUICtrlCreateLabel("Nume:", 32, 48, 35, 17) $ffnume = GUICtrlCreateInput("", 115, 44, 121, 21) GUICtrlCreateLabel("Cod Fiscal (RO):", 32, 72, 81, 17) $ffro = GUICtrlCreateInput("", 115, 68, 121, 21) GUICtrlCreateLabel("Numar Inreg (J):", 32, 96, 79, 17) $ffj = GUICtrlCreateInput("", 115, 92, 121, 21) GUICtrlCreateLabel("Localitate:", 33, 121, 53, 17) $fflocalitate = GUICtrlCreateInput("", 115, 115, 121, 21) GUICtrlCreateLabel("Adresa:", 33, 145, 40, 17) $ffadresa = GUICtrlCreateInput("", 115, 139, 121, 21) GUICtrlCreateLabel("Judet:", 32, 168, 33, 17) $ffjudet = GUICtrlCreateInput("", 115, 163, 121, 21) GUICtrlCreateLabel("Cap Social:", 32, 192, 58, 17) $ffcapsoc1 = GUICtrlCreateInput("", 139, 188, 41, 21) $ffcapsoc2 = GUICtrlCreateInput("", 195, 188, 41, 21) GUICtrlCreateLabel("intre:", 109, 192, 27, 17) GUICtrlCreateLabel("si", 183, 191, 11, 17) GUICtrlCreateLabel("Punct Lucru:", 263, 47, 65, 17) $ffpunctlucru = GUICtrlCreateInput("", 336, 43, 121, 21) GUICtrlCreateLabel("Pers Contact:", 264, 71, 68, 17) $ffperscontact = GUICtrlCreateInput("", 336, 67, 121, 21) GUICtrlCreateLabel("Telefon:", 263, 96, 43, 17) $fftel = GUICtrlCreateInput("", 336, 91, 121, 21) GUICtrlCreateLabel("Fax:", 264, 120, 24, 17) $fffax = GUICtrlCreateInput("", 336, 114, 121, 21) GUICtrlCreateLabel("Mail:", 264, 144, 26, 17) $ffmail = GUICtrlCreateInput("", 336, 138, 121, 21) GUICtrlCreateLabel("URL:", 265, 167, 29, 17) $ffurl = GUICtrlCreateInput("", 336, 162, 121, 21) GUICtrlCreateLabel("Banca1:", 480, 49, 44, 17) $ffbanca1 = GUICtrlCreateInput("", 528, 44, 121, 21) GUICtrlCreateLabel("Banca2:", 480, 72, 44, 17) $ffbanca2 = GUICtrlCreateInput("", 528, 67, 121, 21) GUICtrlCreateLabel("Banca3:", 480, 96, 44, 17) $ffbanca3 = GUICtrlCreateInput("", 528, 90, 121, 21) $ffexclusiv = GUICtrlCreateCheckbox("Toate filtrele/Oricare dintre ele", 480, 192, 160, 21) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group2 = GUICtrlCreateGroup("Ce afisez", 16, 240, 649, 177) $afnume = GUICtrlCreateCheckbox("Nume", 32, 264, 97, 17) GUICtrlSetState($afnume, $GUI_CHECKED) $afro = GUICtrlCreateCheckbox("Cod Fiscal (RO)", 32, 288, 97, 17) $afj = GUICtrlCreateCheckbox("Numar Inreg (J)", 32, 312, 97, 17) GUICtrlSetState($afnume, $GUI_CHECKED) $aflocalitate = GUICtrlCreateCheckbox("Localitatea", 32, 336, 97, 17) $afadresa = GUICtrlCreateCheckbox("Adresa", 32, 360, 97, 17) $afjudet = GUICtrlCreateCheckbox("Judet", 32, 384, 97, 17) $afcapsocial = GUICtrlCreateCheckbox("Cap Social", 160, 264, 97, 17) $afpunctlucru = GUICtrlCreateCheckbox("Punct lucru", 160, 288, 97, 17) $afperscontact = GUICtrlCreateCheckbox("Pers Contact", 160, 312, 97, 17) $aftelefon = GUICtrlCreateCheckbox("Telefon", 160, 336, 97, 17) $affax = GUICtrlCreateCheckbox("Fax", 160, 360, 97, 17) $afmail = GUICtrlCreateCheckbox("Mail", 160, 384, 97, 17) $afurl = GUICtrlCreateCheckbox("URL", 280, 264, 97, 17) $afcont1 = GUICtrlCreateCheckbox("Cont1", 400, 264, 97, 17) $afbanca1 = GUICtrlCreateCheckbox("Banca1", 400, 288, 97, 17) $afcont2 = GUICtrlCreateCheckbox("Cont2", 400, 312, 97, 17) $afbanca2 = GUICtrlCreateCheckbox("Banca2", 400, 336, 97, 17) $afcont3 = GUICtrlCreateCheckbox("Cont3", 400, 360, 97, 17) $afbanca3 = GUICtrlCreateCheckbox("Banca3", 400, 382, 97, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Button1 = GUICtrlCreateButton("Genereaza lista", 265, 425, 139, 33) GUICtrlSetOnEvent(-1, "listafurnizori") GUICtrlSetFont(-1, 12, 400, 0, "MS Sans Serif") GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "outgenereazalistafurnizori") EndFunc Func outgenereazalistafurnizori() GUIDelete($Formlistafurnizori) EndFunc ;== Func listafurnizori() Global $IE, $Formlistafurnizori2 Global $Formlistafurnizori2, $furcli, $urlll, $GUIActiveX if $Formlistafurnizori2 Then GUIDelete($Formlistafurnizori2) EndIf ; Test command line If ($CmdLine[0] = 2) And ($CmdLine[1] = "\IeFileSave") Then $iPPID = Int(StringTrimLeft($CmdLine[2], 6)) ; Get \PPID:n parameter While ProcessExists($iPPID) ; Terminate if parent does If WinExists("[TITLE:Lista Furnizori]", "") Then $hWin = WinGetHandle("[TITLE:Lista Furnizori]", "") ; Get dialog handle ControlSend($hWin, "", "", "{ENTER}") ; Send 'OK' ExitLoop EndIf Sleep(100) WEnd Exit EndIf $furcli="furnizori" $IE = _IECreateEmbedded() $Formdebloc = GUICreate("Lista furnizori", @DesktopWidth-100, @DesktopHeight-100, -1, -1) $GUIActiveX = GUICtrlCreateObj( $IE, 1, 1, @DesktopWidth-102, @DesktopHeight-200) GUICtrlCreateButton("Print", (@DesktopWidth-100)/2-87, @DesktopHeight-150, 177, 41) GUICtrlSetOnEvent(-1, "printfurnizori") GUICtrlCreateButton("Export Excel", (@DesktopWidth-100)/2+90, @DesktopHeight-150, 177, 41) GUICtrlSetOnEvent(-1, "excelfurnizori") $urlll="http://localhost/pos/furcli.php?a="&$furcli&"&&ffexclusiv="&_GUICtrlButton_GetState($ffexclusiv)&"&&afnume="&_GUICtrlButton_GetState($afnume)&"&&afro="&_GUICtrlButton_GetState($afro)&"&&afj="&_GUICtrlButton_GetState($afj)&"&&aflocalitate="&_GUICtrlButton_GetState($aflocalitate)&"&&afadresa="&_GUICtrlButton_GetState($afadresa)&"&&afjudet="&_GUICtrlButton_GetState($afjudet)&"&&afcapsocial="&_GUICtrlButton_GetState($afcapsocial)&"&&afpunctlucru="&_GUICtrlButton_GetState($afpunctlucru)&"&&afperscontact="&_GUICtrlButton_GetState($afperscontact)&"&&aftelefon="&_GUICtrlButton_GetState($aftelefon)&"&&affax="&_GUICtrlButton_GetState($affax)&"&&afmail="&_GUICtrlButton_GetState($afmail)&"&&afurl="&_GUICtrlButton_GetState($afurl)&"&&afcont1="&_GUICtrlButton_GetState($afcont1)&"&&afbanca1="&_GUICtrlButton_GetState($afbanca1)&"&&afcont2="&_GUICtrlButton_GetState($afcont2)&"&&afbanca2="&_GUICtrlButton_GetState($afbanca2)&"&&afcont3="&_GUICtrlButton_GetState($afcont3)&"&&afbanca3="&_GUICtrlButton_GetState($afbanca3)&"&&ffnume="&GUICtrlRead($ffnume)&"&&ffro="&GUICtrlRead($ffro)&"&&ffj="&GUICtrlRead($ffj)&"&&fflocalitate="&GUICtrlRead($fflocalitate)&"&&ffadresa="&GUICtrlRead($ffadresa)&"&&ffjudet="&GUICtrlRead($ffjudet)&"&&ffcapsocial1="&GUICtrlRead($ffcapsoc1)&"&&ffcapsocial2="&GUICtrlRead($ffcapsoc2)&"&&ffpunctlucru="&GUICtrlRead($ffpunctlucru)&"&&ffperscontact="&GUICtrlRead($ffperscontact)&"&&fftelefon="&GUICtrlRead($fftel)&"&&fffax="&GUICtrlRead($fffax)&"&&ffmail="&GUICtrlRead($ffmail)&"&&ffurl="&GUICtrlRead($ffurl)&"&&afcont1="&_GUICtrlButton_GetState($afcont1)&"&&ffbanca1="&GUICtrlRead($ffbanca1)&"&&ffbanca2="&GUICtrlRead($ffbanca2)&"&&ffbanca3="&GUICtrlRead($ffbanca3) ;~ MsgBox(-1, "", $urlll) _IENavigate($IE, $urlll) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "outlistafurnizori") EndFunc Func outlistafurnizori() GUIDelete($Formlistafurnizori2) EndFunc ;== Func excelfurnizori() $IE2 = _IECreateEmbedded() $Formdebloc2 = GUICreate("Lista furnizoricc", @DesktopWidth-100, @DesktopHeight-100, -1, -1) $GUIActiveX2 = GUICtrlCreateObj( $IE2, 1, 1, @DesktopWidth-102, @DesktopHeight-200) $urlll2=$urlll&"&&export=1" Run(@ScriptFullPath & " \IeFileSave \PPID:" & @AutoItPID) _IENavigate($IE2, $urlll2) GUISetState(@SW_HIDE) sleep(5000) GUIDelete($Formdebloc2) EndFunc ;== Func printfurnizori() $IE.execWB(7,2) ; IDM_PRINTPREVIEW not work EndFunc -
Lost control after _IECreateEmbedded
ShadowElf replied to ShadowElf's topic in AutoIt General Help and Support
this function is executed when press a button. when i press the button, i lost control of all aplication -
Func excelfurnizori() $IE2 = _IECreateEmbedded() $Formdebloc2 = GUICreate("Lista furnizoricc", @DesktopWidth-100, @DesktopHeight-100, -1, -1) $GUIActiveX2 = GUICtrlCreateObj( $IE2, 1, 1, @DesktopWidth-102, @DesktopHeight-200) $urlll2=$urlll&"&&export=1" _IENavigate($IE2, $urlll2) GUISetState(@SW_HIDE) sleep(5000) GUIDelete($Formdebloc2) EndFunc the php url contain: $filename ="excelreport.xls"; header('Content-type: application/ms-excel'); header('Content-Disposition: attachment; filename='.$filename); and then a table when I start this function, it ask me to save excelreport.xls, but after that I lost controll of all the aplication, no butoon work, no close.. etc any sugestion?