Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/14/2017 in all areas

  1. Hello. Return type is Long. LONG ChangeDisplaySettingsEx( _In_ LPCTSTR lpszDeviceName, _In_ DEVMODE *lpDevMode,      HWND    hwnd, _In_ DWORD   dwflags, _In_ LPVOID  lParam ); Saludos
    1 point
  2. @jeremyroberts what is the end goal with pressing the spacebar so often? Sending keys is always going to be a little unreliable; there is more than likely a much better way to accomplish what you are after.
    1 point
  3. from here: http://www.math.uiuc.edu/~gfrancis/illimath/windows/aszgard_mini/bin/MinGW/include/winuser.h #define DISP_CHANGE_SUCCESSFUL 0 #define DISP_CHANGE_RESTART 1 #define DISP_CHANGE_BADFLAGS (-4) #define DISP_CHANGE_BADPARAM (-5) #define DISP_CHANGE_FAILED (-1) #define DISP_CHANGE_BADMODE (-2) #define DISP_CHANGE_NOTUPDATED (-3)
    1 point
  4. Skysnake, Try this tutorial and see if it clears some of the fog. M23
    1 point
  5. Increase the height of the label control?
    1 point
  6. Hi jeremyroberts With this you can use F1 to pause and unpause Global $Paused HotKeySet("{F1}", "TogglePause") While 1 Send("{SPACE}") sleep(25) WEnd While 1 Sleep(100) WEnd ;;;;;;;; Func TogglePause() $Paused = Not $Paused While $Paused Sleep(100) ToolTip('Script is "Paused"', 0, 0) WEnd ToolTip("") EndFunc
    1 point
  7. hello. Something like this should work... #include <GUIConstantsEx.au3> #include <GuiImageList.au3> #include <GuiListView.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Global $oListView = 0 Example() Func Example() Local $hImage ; Create GUI GUICreate("ListView Add SubItem", 400, 300) $oListView = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_SUBITEMIMAGES)) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) ; Add columns _GUICtrlListView_InsertColumn($oListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($oListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($oListView, 2, "Column 3", 100) Local $aItems[] = [ _ "BLACK | " & $CLR_BLACK & "|" & "", _ "BLUE | " & $CLR_BLUE & "|" & "", _ "RED | " & $CLR_RED & "|" & "", _ "WHITE | " & $CLR_WHITE & "|" & "", _ "YELLOW | " & $CLR_YELLOW & "|" & "" _ ] _GUICtrlListView_BeginUpdate($oListView) _GUICtrlListView_DeleteAllItems($oListView) For $ndx = 0 To UBound($aItems) - 1 $text = $aItems[$ndx] $parts = StringSplit($text, "|", 2) $parts[0] = StringStripWS($parts[0], 3) $parts[2] = StringStripWS($parts[2], 3) $iIndex = _GUICtrlListView_AddItem($oListView, $parts[0], -1, $parts[1]) _GUICtrlListView_AddSubItem($oListView, $iIndex, Hex($parts[1]), 1) _GUICtrlListView_AddSubItem($oListView, $iIndex, $parts[0], 2) Next _GUICtrlListView_EndUpdate($oListView) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Func WM_NOTIFY($hWnd, $Msg, $wParam, $lParam) Local $tNMHDR, $hWndFrom, $iCode $tNMHDR = DllStructCreate($tagNMHDR, $lParam) $hWndFrom = DllStructGetData($tNMHDR, "hWndFrom") $iCode = DllStructGetData($tNMHDR, "Code") $g_hListView = GUICtrlGetHandle($oListView) Switch $hWndFrom Case $g_hListView Switch $iCode Case $NM_CUSTOMDRAW Local $tCustDraw = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $iDrawStage = DllStructGetData($tCustDraw, "dwDrawStage") If $iDrawStage = $CDDS_PREPAINT Then Return $CDRF_NOTIFYITEMDRAW If $iDrawStage = $CDDS_ITEMPREPAINT Then Return $CDRF_NOTIFYSUBITEMDRAW Local $iSubItem = DllStructGetData($tCustDraw, "iSubItem") Local $iItem = DllStructGetData($tCustDraw, "dwItemSpec") Local $iColor = $CLR_BLACK If $iSubItem = 2 Then $iColor = ("0x" & _GUICtrlListView_GetItemText($g_hListView, $iItem, 1)) Else $iColor = $CLR_BLACK EndIf DllStructSetData($tCustDraw, "clrText", $iColor) Return $CDRF_NEWFONT EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Saludos
    1 point
  8. Here is the version using regexp #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = 'powershell $test = (reg query ' & $sKeyname & ' /v ' & $sValuename & '); ([regex]::Match($test,''\.\\.+$'')).Groups[0].Value' Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF) Saludos
    1 point
  9. once substring does its magic you can split on whatever you want: $matches is the magical return of -match that houses the data (-match just returns a boolean to the console) #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = "powershell $test = reg query " & $sKeyname & ' /v ' & $sValuename & " ; $test[2].substring(0) -match '\w+\\\w+$' ; $matches" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF) another example of how to use matches (dumps the boolean to null and retrieves only the domain\user in the stdout): #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = "powershell $test = reg query " & $sKeyname & ' /v ' & $sValuename & " ; $test[2].substring(0) -match '\w+\\\w+$' | out-null ; echo $matches[0]" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF) This one showing how to use .split to just get the username from the second line #include <AutoItConstants.au3> Local $sComputer = @ComputerName Local $sKeyname = '"\\' & $sComputer & '\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Authentication\LogonUI" /REG:64' Local $sValuename = "LastLoggedOnUser" Local $sCmd = "powershell $test = reg query " & $sKeyname & ' /v ' & $sValuename & " ; $test[2].substring(0).split('\')[-1]" Local $sOut, $hPid = Run($sCmd, "", @SW_HIDE, $STDERR_MERGED) Do $sOut &= StdoutRead($hPid) Until @error ConsoleWrite($sOut & @CRLF)
    1 point
  10. I would also recommend Foxit Reader; it's fast. light and best of all for me, can silently print a PDF file via command line (can also install silent). Using this UDF, the PDFCreator COM interface, Foxit Reader and IrfanView, I have been able to completely automate scanning, converting, splitting, combining new or existing docs from paper, Word, TIF, JPG or any printable doc to PDF, ready for fax, email, print or archive and finally generate a PDF work order, report or invoice which I can print or email. Thank you @taitel, you have made my work so much easier, smarter and professional.
    1 point
×
×
  • Create New...