Jump to content

DutchCoder

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by DutchCoder

  1. Wrote my own Interface UDF in plain AutoIt (without GDI+...) Took some OCD to create all the Look-'n-Feelz, animations and shadows, but very rewarding. Some simple examples...
  2. Windows 11 also has a similar feature built-in (Settings -> Personalization -> Colors -> Show accent color on title bars and windows borders)
  3. Func _CreateLabel($_text, $_x, $_y, $_w = Default, $_h = Default, $_style = Default, $_fgcol = Default, $_bkcol = 0) Local $_d[4][2] = [[0, -1], [0, 1], [-1, 0], [1, 0]] For $_z = 0 To 3 GUICtrlCreateLabel($_text, $_x + $_d[$_z][0], $_y + $_d[$_z][1], $_w, $_h, $_style) GUICtrlSetColor(-1, $_bkcol) GUICtrlSetBkColor(-1, -2) Next $_label = GUICtrlCreateLabel($_text, $_x, $_y, $_w, $_h, $_style) GUICtrlSetColor(-1, $_fgcol) GUICtrlSetBkColor(-1, -2) Return $_label EndFunc Func _SetLabelData($_handle, $_data) For $_z = 0 To 4 GUICtrlSetData($_handle - $_z, $_data) Next EndFunc Simple solution as replacement for your GUICtrlCreateLabel() and GUICtrlSetData()
  4. Wait for Mouse to move (two ways) Normally when you have a GUI you can use this: Func _MouseWaitMove() Do Sleep(100) Until GuiGetMsg() = -11 EndFunc But sometimes you don't have a GUI. This one always works: Func _MouseWaitMove() $_old = MouseGetPos() Do Sleep(100) $_new = MouseGetPos() Until ($_new[0] - $_old[0]) Or ($_new[1] - $_old[1]) EndFunc
  5. Since Windows 7 and Server 2008 the function UpdateSystemParametersPerUser does not work in a stable way anymore, using USER32.DLL They say It was an undocumented feature from the beginning... If you want to make the scripted Desktop Wallpaper effective right away, you can use this Function to make it happen. Func MakeWallpaperEffective() ;~ DllCall("user32.dll", "", "UpdatePerUserSystemParameters") ; Obsolete Local $SPI_SETDESKWALLPAPER = 0x14 Local $SPIF_UPDATEINIFILE = 0x1 Local $SPIF_SENDCHANGE = 0x2 DllCall("user32.dll", _ "int", "SystemParametersInfo", _ "int", $SPI_SETDESKWALLPAPER, _ "int", 0, _ "str", RegRead("HKCU\Control Panel\Desktop", "Wallpaper"), _ "int", BitOR($SPIF_UPDATEINIFILE, $SPIF_SENDCHANGE)) EndFunc
  6. I needed it myself and found out it was never soveld on the forums... See my rebuilt notepad replacement into Excel replacement by rewriting three lines of code. (Ribbon code in plain GDI is not available. sorry)
  7. Try this: $oExcel.Application.ExecuteExcel4Macro('SHOW.TOOLBAR("Ribbon",False)')
  8. Is this question not simply solved by GUISetFont ?
  9. I wrote a little routine for you (and others) I hope it helps #include <GUIConstants.au3> #include <GuiStatusbar.au3> AutoItSetOption('MouseCoordMode', 2) $DividerOffset = 330 $Form1 = GUICreate("Test", 660, 320, 192, 125, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP)) $ListView1 = GUICtrlCreateListView("col1|col2|col3", 5, 5, $DividerOffset - 5, 310) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKWIDTH)) $ListView2 = GUICtrlCreateListView("col1|col2|col3", $DividerOffset + 5, 5, 660 - $DividerOffset - 10, 310) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKRIGHT)) $Divider = GUICtrlCreateLabel('', $DividerOffset, 5, 5, 310) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKRIGHT)) GUICtrlSetCursor(-1, 13) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $Divider Resize() EndSwitch WEnd Exit Func Resize() GUISetCursor(13, 1, $Form1) $siz = WinGetClientSize($Form1) Do $arr = GUIGetCursorInfo($Form1) $pos = MouseGetPos(0) Select Case $pos < 100 $pos = 100 Case $pos > $siz[0] - 100 $pos = $siz[0] - 100 EndSelect If $pos <> $DividerOffset Then $DividerOffset = $pos GUICtrlSetPos($ListView1, -1, -1, $DividerOffset - 5) GUICtrlSetPos($ListView2, $DividerOffset + 5, -1, $siz[0] - $DividerOffset - 10) EndIf Until Not $arr[2] GUICtrlSetPos($Divider, $DividerOffset) GUISetCursor(-1, 0, $Form1) EndFunc
  10. Your primairy problem lies in the $WS_CLIPCHILDREN on GUICreate This would be the working code: #include <GUIConstants.au3> #include <GuiStatusbar.au3> opt("GUIResizeMode",$GUI_DOCKAUTO) $Form1 = GUICreate("Test", 660, 320, 192, 125, BitOr($WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)) $ListView1 = GUICtrlCreateListView("col1|col2|col3",10, 10, 200, 300, -1, $WS_EX_CLIENTEDGE) $ListView2 = GUICtrlCreateListView("col1|col2|col3", 215, 10, 435, 300, -1, $WS_EX_CLIENTEDGE) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd Exit But more little things like $WS_EX_CLIENTEDGE are used om GUICtrlCreateListView... I would start with the following to have the edges stay the same width: #include <GUIConstants.au3> #include <GuiStatusbar.au3> $Form1 = GUICreate("Test", 660, 320, 192, 125, BitOR($WS_OVERLAPPEDWINDOW, $WS_POPUP)) $ListView1 = GUICtrlCreateListView("col1|col2|col3",10, 10, 200, 300) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKWIDTH)) $ListView2 = GUICtrlCreateListView("col1|col2|col3", 215, 10, 435, 300) GUICtrlSetResizing(-1, BitOR($GUI_DOCKLEFT, $GUI_DOCKTOP, $GUI_DOCKBOTTOM, $GUI_DOCKRIGHT)) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Exit
  11. By default a window is created with the "Client Area" of the dimensions mentioned. So Windows will have the default borders and title bar "around" this area, according to the Theme chosen in Windows. For this you need a GUI Control Style of 128 (Hex 80) It will not allow you to create a window with all possibilities of normal application windows, but will do the trick. $hWnd = GUICreate("box", $diffX, $diffY, $negX, $y, 0x00080080)
  12. $objShell = ObjCreate('Shell.Application') $objFolder = $objShell.NameSpace('Destination Folder') ; Use the right folder as destination $ProcessID = $objFolder.CopyHere('Source Folder') ; Initiate the command ProcessWaitClose($ProcessID) ; Wait for copy to end and Yes, MoveHere also works
×
×
  • Create New...