Die Größe des Ordners unter der aktuellen Mausposition? Genau diese Funktion besitzt Windows doch von Haus aus schon. Wozu erneut programmieren?
Beiträge von zemkedesign
-
-
Check mal RegEnumKey.
Damit kannst du dir die Schlüssel unterhalb eines Schlüssels ausgeben lassen. -
InputBox ( "title", "Prompt" [, "Default" [, "password char" [, width, height [, left, top [, timeOut [, hwnd]]]]]] )
-
Der SHIFT+F10-Rechtsklick sollte für das aktuelle Element gelten oder wird dann ein allgemeines Kontextmenü geöffnet?
Bei vielen Programmen gibt es oft die Kontextfunktionen auch im Menü.
Ansonsten mit PixelSearch nach der blauen Markierung suchen.
-
SHIFT + F10 simuliert den Rechtsklick. Vielleicht kannst du damit dein Mausklick umgehen.
-
Zeig doch mal den Code oder die entsprechende Stelle.
-
Check mal GUISetOnEvent in der Hilfe.
-
Im englischen Forum hab ichs gefunden:
http://www.autoitscript.com/forum/index.php?showtopic=86871 -
Habs lauffähig gemacht:
Spoiler anzeigen
[autoit]Run("notepad.exe")
[/autoit] [autoit][/autoit] [autoit]
WinWait("Unbenannt")
HotKeySet("{pause}", "pause0")
SendKeepActive("Unbenannt")
$play = 1
$zahl = 1While True
[/autoit] [autoit][/autoit] [autoit]
If $play = 1 Then
If $zahl > 10000 Then Exitloop
$zahl = $zahl + 1
Send($zahl & "{enter}")
EndIf
Sleep(10)
WEndFunc pause0()
[/autoit]
If $play = 1 Then
$play = 0
Else
$play = 1
EndIf
EndFunc ;==>pause0 -
Aktivierst du die Pause, läuft die For-Schleife trotzdem durch, schreibt nur nichts in den Editor.
Du musst also innerhalb des einen For-Schleifen-Durchlaufs pausieren, d.h. eine Schleife, die den Pausewert abfragt und erst bei True weitermacht.
-
GUI = Graphic User Interface
zu deutsch: Grafische BenutzeroberflächeEdit: Da der Threatersteller seinen Beitrag geändert hat, gehört die Antwort nur zu 1.
-
Listview oder Listbox?
-
Diese Funktionalität ist bereits im Firefox integriert Aber für den IE ist es sicher nützlich.
-
Ist doch mittlerweile fast Standard, dass Kontakte von Steckern vergoldet werden, da Gold eine gute Leitfähigkeit hat.
-
Du kannst auch weiterhin dein StringSplit nutzen, denn wird der Punkt nicht gefunden, wird @error auf 1 gesetzt.
-
Check mal CDTray(...)
-
Und was ist jetzt die Frage?
-
Füg mal nach dem Run eine weitere Zeile ein:
[autoit]MsgBox(0, "", @error)
[/autoit]
Ich bin mir ziemlich sicher, dass auch diese Msgbox angezeigt wird. -
Solange die ganze Zeile eingefärbt werden kann, ist Variante 1 wohl wesentlich passender. Variante 2 sollte man wohl nur nutzen, wenn man bspw. nur das online bzw. offline (also eine Zelle) einfärben wollte.
-
Spoiler anzeigen
[autoit]#include <ListViewConstants.au3>
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
#include <StructureConstants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>
#Include <GuiConstantsEx.au3>
#Include <GuiListView.au3>;fonts for custom draw example
[/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]
;bold
Global $aFont1 = DLLCall("gdi32.dll","int","CreateFont", "int", 14, "int", 0, "int", 0, "int", 0, "int", 700, _
"dword", 0, "dword", 0, "dword", 0, "dword", 0, "dword", 0, "dword", 0, "dword", 0, _
"dword", 0, "str", "")
;italic
Global $aFont2 = DLLCall("gdi32.dll","int","CreateFont", "int", 14, "int", 0, "int", 0, "int", 0, "int", 400, _
"dword", 1, "dword", 0, "dword", 0, "dword", 0, "dword", 0, "dword", 0, "dword", 0, _
"dword", 0, "str", "")$GUI = GUICreate("Listview Custom Draw", 400, 300)
[/autoit] [autoit][/autoit] [autoit]$cListView = GUICtrlCreateListView("", 2, 2, 394, 268, -1, BitOR($LVS_EX_GRIDLINES, $LVS_EX_FULLROWSELECT))
[/autoit] [autoit][/autoit] [autoit]
$hListView = GUICtrlGetHandle($cListView)_GUICtrlListView_InsertColumn($hListView, 0, "Column 1", 100)
[/autoit] [autoit][/autoit] [autoit]
_GUICtrlListView_InsertColumn($hListView, 1, "Column 2", 100)
_GUICtrlListView_InsertColumn($hListView, 2, "Column 3", 100); Add items
[/autoit] [autoit][/autoit] [autoit]
For $i = 1 To 30
_GUICtrlListView_AddItem($hListView, "Row" & $i & ": Col 1", $i-1)
For $j = 1 To 2
_GUICtrlListView_AddSubItem ($hListView, $i-1, "Row" & $i & ": Col " & $j+1, $j)
Next
NextGUICtrlCreateInput("", 50, 275, 100, 15)
[/autoit] [autoit][/autoit] [autoit]GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
[/autoit] [autoit][/autoit] [autoit]
GUISetState()Do
[/autoit] [autoit][/autoit] [autoit]
Until GUIGetMsg() = $GUI_EVENT_CLOSE
DLLCall("gdi32.dll","int","DeleteObject", "hwnd", $aFont1[0])
DLLCall("gdi32.dll","int","DeleteObject", "hwnd", $aFont2[0])
ExitFunc WM_NOTIFY($hWnd, $Msg, $wParam, $lParam)
[/autoit] [autoit][/autoit] [autoit]
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR$tNMHDR = DllStructCreate($tagNMHDR, $lParam)
[/autoit] [autoit][/autoit] [autoit]
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hListView
Switch $iCode
Case $NM_CUSTOMDRAW
If Not _GUICtrlListView_GetViewDetails($hWndFrom) Then Return $GUI_RUNDEFMSG
Local $tCustDraw = DllStructCreate('hwnd hwndFrom;int idFrom;int code;' & _
'dword DrawStage;hwnd hdc;long rect[4];dword ItemSpec;int ItemState;dword Itemlparam;' & _
'dword clrText;dword clrTextBk;int SubItem;' & _
'dword ItemType;dword clrFace;int IconEffect;int IconPhase;int PartID;int StateID;long rectText[4];int Align', _ ;winxp or later
$lParam), $iDrawStage, $iItem, $iSubitem, $hDC, $tRect, $iColor1, $iColor2, $iColor3
$iDrawStage = DllStructGetData($tCustDraw, 'DrawStage')
Switch $iDrawStage
Case $CDDS_PREPAINT
Return $CDRF_NOTIFYITEMDRAW
Case $CDDS_ITEMPREPAINT
Return $CDRF_NOTIFYSUBITEMDRAW
Case $CDDS_ITEMPOSTPAINT
Case BitOR($CDDS_ITEMPREPAINT, $CDDS_SUBITEM)
$iItem = DllStructGetData($tCustDraw, 'ItemSpec')
$iSubitem = DllStructGetData($tCustDraw, 'SubItem')
If _GUICtrlListView_GetItemSelected($hWndFrom, $iItem) Then
$hDC = _WinAPI_GetDC($hWndFrom)
$tRect = DllStructCreate('long;long;long;long')
If $iSubitem = 0 Then
DllCall('user32.dll','int','SendMessage', 'hwnd',$hWndFrom, 'uint',$LVM_GETSUBITEMRECT, 'wparam',$iItem, 'lparam',DllStructGetPtr($tRect))
DllStructSetData($tRect, 1, 2)
DllCall('user32.dll', 'int', 'FillRect', 'ptr', $hDC, 'ptr', DllStructGetPtr($tRect), 'int', _WinAPI_GetStockObject(4))
EndIf
DllStructSetData($tRect, 1, 2)
DllStructSetData($tRect, 2, $iSubitem)
DllCall('user32.dll','int','SendMessage', 'hwnd',$hWndFrom, 'uint',$LVM_GETSUBITEMRECT, 'wparam',$iItem, 'lparam',DllStructGetPtr($tRect))
Local $sText = _GUICtrlListView_GetItemText($hWndFrom, $iItem, $iSubitem)
DLLCall("gdi32.dll","int","SetTextColor", "ptr", $hDC, "int", RGB2BGR(0xffff00))
DLLCall("gdi32.dll","int","SetBkMode", "ptr", $hDC, "int", 1)
DllStructSetData($tRect, 1, DllStructGetData($tRect, 1)+2)
_WinAPI_DrawText($hDC, $sText, $tRect, 0x8000) ;; $DT_END_ELLIPSIS
_WinAPI_ReleaseDC($hWndFrom, $hDC)
Return $CDRF_SKIPDEFAULT
EndIf
Switch $iItem
Case 0 To 9 ;for rows 1-10 lets do this
$iColor1 = RGB2BGR(0xFBFFD8)
$iColor2 = RGB2BGR(-1)
$iColor3 = RGB2BGR(0xFF0000)
If Mod($iSubitem, 2) Then ;odd columns
DllStructSetData($tCustDraw, 'clrTextBk', $iColor1)
DllStructSetData($tCustDraw, 'clrText', 0)
Else ;even columns
DllStructSetData($tCustDraw, 'clrTextBk', $iColor2)
DllStructSetData($tCustDraw, 'clrText', $iColor3)
EndIf
Case 10 To 19 ;for rows 11-20 lets do this
$iColor1 = RGB2BGR(0xFBFFD8)
$iColor2 = RGB2BGR(0x3DF8FF)
$hDC = DllStructGetData($tCustDraw, 'hdc')
If Mod($iItem, 2) Then
If Mod($iSubitem, 2) Then
DllStructSetData($tCustDraw, 'clrTextBk', $iColor1)
Else
DllStructSetData($tCustDraw, 'clrTextBk', $iColor2)
EndIf
DLLCall("gdi32.dll","hwnd","SelectObject", "hwnd", $hDC, "hwnd", $aFont1[0]) ;select our chosen font into DC
Else
If Mod($iSubitem, 2) Then
DllStructSetData($tCustDraw, 'clrTextBk', $iColor2)
Else
DllStructSetData($tCustDraw, 'clrTextBk', $iColor1)
EndIf
DLLCall("gdi32.dll","hwnd","SelectObject", "hwnd", $hDC, "hwnd", $aFont2[0])
EndIf
Case 20 To 29 ;for rows 21-30 lets do this
$iColor1 = RGB2BGR(0xFBFFD8)
$iColor2 = RGB2BGR(-1)
If Mod($iItem, 2) Then ;odd rows
DllStructSetData($tCustDraw, 'clrTextBk', $iColor2)
Else
DllStructSetData($tCustDraw, 'clrTextBk', $iColor1)
EndIf
EndSwitch
Return $CDRF_NEWFONT
Case BitOR($CDDS_ITEMPOSTPAINT, $CDDS_SUBITEM)
Case Else
EndSwitch
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFYFunc RGB2BGR($iColor)
[/autoit]
Return BitAND(BitShift(String(Binary($iColor)), 8), 0xFFFFFF)
EndFunc
Das Beispiel funktioniert. Ich hab lediglich Includes und Konstanten der Quelle korrigiert.
Quelle