Jump to content

sulfur

Members
  • Posts

    9
  • Joined

  • Last visited

sulfur's Achievements

Seeker

Seeker (1/7)

2

Reputation

  1. ok, I got the solution. My Systray instance is 3 not 1. We may close the topic.
  2. I running this script to get buttons number and close some of them then #Include <GuiToolBar.au3> $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) I expect that $iSystray_ButCount will contain number of buttons in system tray, but it is equal to 1 after the script. How I can get system tray buttons to close some of them? PS: I found this old topic but it doesnt work as is
  3. looks like it's the right answer I added #AutoIt3Wrapper_UseX64=Y to the script and now it works well. Problem solved, thanks!
  4. Thanks, Nine. Just tryed, but result is same.
  5. #RequireAdmin #include <WinAPIProc.au3> #include <WinAPI.au3> #include <StringConstants.au3> Global $aAdjust Func ImproveMainCaptions($aProcList) $iProcessNumer = $aProcList[0][0] For $i = 1 To $iProcessNumer $ID = $aProcList[$i][1] $sCmdLine = _WinAPI_GetProcessCommandLine($ID) $str = "Err:" & @error & " Line:" & $sCmdLine MsgBox($MB_SYSTEMMODAL, "Important1CParametersLine", $str) ; here @error is 40 and &str is empty string ; but only on one computer. All others are fine. Next EndFunc ; Main Entry point $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) _WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust) If Not (@error Or @extended) Then $aProcList = ProcessList("1cv8.exe") ImproveMainCaptions($aProcList) _WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust) _WinAPI_CloseHandle($hToken) EndIf markyrocks, thank you for usefull info. I scented that it's a privilege issue. Now, I moved #RequireAdmin to first line and run script again on that computer. Definetly As Administrator. But nothing changed Can I try something else?
  6. Yep, as I tryed to say (sorry for bad english) it works fine everywhere except one concrete computer. So maybe there is another way to get process command line? Or maybe someone know what @error = 40 is?
  7. #include <WinAPIProc.au3> #include <WinAPI.au3> #include <StringConstants.au3> #RequireAdmin Global $aAdjust Func ImproveMainCaptions($aProcList) $iProcessNumer = $aProcList[0][0] For $i = 1 To $iProcessNumer $ID = $aProcList[$i][1] $sCmdLine = _WinAPI_GetProcessCommandLine($ID) $str = "Err:" & @error & " Line:" & $sCmdLine MsgBox($MB_SYSTEMMODAL, "Important1CParametersLine", $str) ; here @error is 40 and &str is empty string ; but only on one computer. All others are fine. Next EndFunc ; Main Entry point While 1 $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) _WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust) If Not (@error Or @extended) Then $aProcList = ProcessList("1cv8.exe") ImproveMainCaptions($aProcList) _WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust) _WinAPI_CloseHandle($hToken) Else Exit EndIf WEnd
  8. I tryed _WinAPI_GetProcessCommandLine example from Help file, and it works great for most computers. But on one computer I got @error=40 and empty string as a result. It's Win10x64 with admin rights, but I have Win10x64 too and for me script works fine. Could you give me advice please? Thank you!
×
×
  • Create New...