Leaderboard
Popular Content
Showing content with the highest reputation on 02/20/2020 in all areas
-
If you have multiple checkboxes back to back, you will need to do something like this : #include <GUIConstants.au3> GUICreate ("") Local $Checkbox1 = GUICtrlCreatePic("UnCheck.bmp", 20, 60, 14, 14) Local $Checkbox2 = GUICtrlCreatePic("UnCheck.bmp", 34, 60, 14, 14) Local $bCheck1 = False, $bCheck2 = False, $iMsg GUISetState () While 1 $iMsg = GUIGetMsg () Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $Checkbox1 GUICtrlSetImage ($Checkbox1, $bCheck1 ? "UnCheck.bmp" : "Check.bmp") $bCheck1 = Not $bCheck1 Case $Checkbox2 GUICtrlSetImage ($Checkbox2, $bCheck2 ? "UnCheck.bmp" : "Check.bmp") $bCheck2 = Not $bCheck2 EndSwitch WEnd There is easy ways to optimized this code, it is just an example. I included the bmp that I used. CheckBox.zip2 points
-
Version 1.7.0.1
10,051 downloads
Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None1 point -
1 point
-
1 point
-
Listview just like Windows Explorer
argumentum reacted to LarsJ for a topic
The only easy way to remove the blue vertical grid lines between the columns is, as far as I know, to overwrite the lines with new lines of the same color as the background color of the listview cells: #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <GuiImageList.au3> #include <WindowsConstants.au3> Global $idListView, $hListView _Main() Func _Main() Local $hImage GUICreate("(Not UDF Created because of speed) ListView Create", 400, 300) $idListView = GUICtrlCreateListView("", 2, 2, 394, 268) $hListView = GUICtrlGetHandle( $idListView ) _GUICtrlListView_SetExtendedListViewStyle($idListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_DOUBLEBUFFER )) DllCall("UxTheme.dll", "int", "SetWindowTheme", "hwnd", $hListView, "wstr", "Explorer", "ptr", 0) ; Set "Vista" Style GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY" ) GUISetState() ; Load images $hImage = _GUIImageList_Create() _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListView, 0xFF0000, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListView, 0x00FF00, 16, 16)) _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListView, 0x0000FF, 16, 16)) _GUICtrlListView_SetImageList($idListView, $hImage, 1) ; Add columns _GUICtrlListView_InsertColumn($idListView, 0, "Column 1", 100) _GUICtrlListView_InsertColumn($idListView, 1, "Column 2", 100) _GUICtrlListView_InsertColumn($idListView, 2, "Column 3", 100) ; Add items _GUICtrlListView_AddItem($idListView, "Row 1: Col 1", 0) _GUICtrlListView_AddSubItem($idListView, 0, "Row 1: Col 2", 1) _GUICtrlListView_AddSubItem($idListView, 0, "Row 1: Col 3", 2) _GUICtrlListView_AddItem($idListView, "Row 2: Col 1", 1) _GUICtrlListView_AddSubItem($idListView, 1, "Row 2: Col 2", 1) _GUICtrlListView_AddItem($idListView, "Row 3: Col 1", 2) ; Loop until user exits Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>_Main Func WM_NOTIFY( $hWnd, $iMsg, $wParam, $lParam ) Local Static $hDC, $hPen = _WinAPI_CreatePen( $PS_SOLID, 1, 0xFFFFFF ), $iHot = -1, $iSel = -1 Local Static $tRect = DllStructCreate( $tagRECT ), $pRect = DllStructGetPtr( $tRect ) Local $tNMHDR = DllStructCreate( $tagNMHDR, $lParam ), $iItem Switch HWnd( DllStructGetData( $tNMHDR, "hWndFrom" ) ) ; $hWndFrom Case $hListView Switch DllStructGetData( $tNMHDR, "Code" ) ; $iCode Case $NM_CUSTOMDRAW Local $tCustDraw = DllStructCreate( $tagNMLVCUSTOMDRAW, $lParam ) Switch DllStructGetData( $tCustDraw, "dwDrawStage" ) ; Specifies the drawing stage Case $CDDS_PREPAINT ; Before the paint cycle begins $hDC = DllStructGetData( $tCustDraw, "hdc" ) DllCall( "gdi32.dll", "handle", "SelectObject", "handle", $hDC, "handle", $hPen ) ; _WinAPI_SelectObject ; Get hot item under mouse $iHot = GUICtrlSendMsg( $idListView, $LVM_GETHOTITEM, 0, 0 ) ; Get selected item For $iItem = 0 To 2 If GUICtrlSendMsg( $idListView, $LVM_GETITEMSTATE, $iItem, $LVIS_SELECTED ) Then ExitLoop Next $iSel = $iItem < 3 ? $iItem : -1 ; Update empty space below last item, item 2 For $iSubItem = 0 To 2 ; For each subitem (column) DllStructSetData( $tRect, "Top", $iSubItem ) DllStructSetData( $tRect, "Left", $LVIR_LABEL ) GUICtrlSendMsg( $idListView, $LVM_GETSUBITEMRECT, 2, $pRect ) ; 2 = last item DllCall( "gdi32.dll", "bool", "MoveToEx", "handle", $hDC, "int", DllStructGetData( $tRect, "Right" )-1, "int", DllStructGetData( $tRect, "Bottom" )+1, "ptr", 0 ) ; _WinAPI_MoveTo ; Just below last item DllCall( "gdi32.dll", "bool", "LineTo", "handle", $hDC, "int", DllStructGetData( $tRect, "Right" )-1, "int", DllStructGetData( $tRect, "Bottom" )+268 ) ; _WinAPI_LineTo ; 268 = height/bottom of LV Next Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT ; Before an item is painted Return $CDRF_NOTIFYPOSTPAINT Case $CDDS_ITEMPOSTPAINT ; After an item has been painted $iItem = DllStructGetData( $tCustDraw, "dwItemSpec" ) Switch $iItem Case $iHot, $iSel ; Hot and selected items Return $CDRF_NEWFONT ; Skip these items Case Else ; Other items For $iSubItem = 0 To 2 ; For each subitem (column) DllStructSetData( $tRect, "Top", $iSubItem ) DllStructSetData( $tRect, "Left", $LVIR_LABEL ) GUICtrlSendMsg( $idListView, $LVM_GETSUBITEMRECT, $iItem, $pRect ) DllCall( "gdi32.dll", "bool", "MoveToEx", "handle", $hDC, "int", DllStructGetData( $tRect, "Right" )-1, "int", DllStructGetData( $tRect, "Top" ), "ptr", 0 ) ; _WinAPI_MoveTo DllCall( "gdi32.dll", "bool", "LineTo", "handle", $hDC, "int", DllStructGetData( $tRect, "Right" )-1, "int", DllStructGetData( $tRect, "Bottom" ) ) ; _WinAPI_LineTo Next Return $CDRF_NEWFONT ; $CDRF_NEWFONT must be returned after changing font or colors EndSwitch EndSwitch EndSwitch EndSwitch Return $GUI_RUNDEFMSG #forceref $hWnd, $iMsg, $wParam EndFunc Note that when using GDI functions in custom draw code, you must be very careful about the performance of the code to avoid executing more code than there is time for. This is the reason why the listview is created with GUICtrlCreateListView() that returns a controlId, so it's possible to use GUICtrlSendMsg() (fast internal function implemented in real compiled C++ code) instead of _SendMessage() (relatively time-consuming UDF function implemented in AutoIt code), which is necessary to use if you only have a control handle. And that's also the reason why only the DLLCall() function is executed for the GDI functions instead of the entire UDF function.1 point -
Pushing the label for the first checkbox to the left seems to work Local $idLabel = GUICtrlCreateCheckbox("", 20, 60, 13, 20, BitOR($BS_AUTOCHECKBOX, $BS_CHECKBOX, $BS_RIGHTBUTTON)) Local $idLabel2 = GUICtrlCreateCheckbox("", 33, 60, 13, 20)1 point
-
I need to block/hook the middle mouse wheel click
FrancescoDiMuro reacted to Bert for a topic
A mouse is cheap. Why not replace it? You can go to a thrift store and get one for less than a dollar1 point -
StringRegExpReplace($String, ".*?(\d+)\.(?:pdf|psd|blend)$", "$1")1 point
-
Issues with WS_EX_ACCEPTFILES and GUI_DROPACCEPTED
jantograaf reacted to Nine for a topic
Well, like M23, it is working fine for me...0 points -
Issues with WS_EX_ACCEPTFILES and GUI_DROPACCEPTED
jantograaf reacted to Melba23 for a topic
jantograaf, Your script as posted runs (when the required includes are added) without problem for me - I get the dropped filename written to the console for every drop. M230 points