Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/06/2012 in all areas

  1. UEZ

    GDI+ questions

    Something like that here? #include <gdiplus.au3> Opt("GUIOnEventMode", 1) _GDIPlus_Startup() Global Const $iW = 800 Global Const $iH = 500 Global Const $hGui = GUICreate("GDI+ Simple Line Rotation", $iW, $iH) GUISetState() _GDIPlus_Startup() Global Const $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) Global Const $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics) Global Const $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) Global Const $hPen = _GDIPlus_PenCreate(0xFFF0F0F0, 1) _GDIPlus_GraphicsSetSmoothingMode($hContext, 2) _GDIPlus_GraphicsClear($hContext, 0xFF000000) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iW, $iH) GUISetOnEvent(-3, "_Exit") Global Const $fRadians = ACos(-1) / 180 Global Const $iRadius = 200 Global Const $iStart_deg = Random(-180, 180, 1) Global $iSpeed = Random(-3, 3, 1) Global Const $iCenterX = $iW / 2 Global Const $iCenterY = $iH / 2 AdlibRegister("Animate", 30) While Sleep(1000) WEnd Func Animate() Local Static $degree = $iStart_deg _GDIPlus_GraphicsClear($hContext, 0xFF000000) _GDIPlus_GraphicsDrawLine($hContext, $iCenterX, $iCenterY, _ $iCenterX + Cos($degree * $fRadians) * $iRadius, _ $iCenterY + Sin($degree * $fRadians) * $iRadius, $hPen) _GDIPlus_GraphicsDrawImageRect($hGraphics, $hBitmap, 0, 0, $iW, $iH) $degree = Mod($degree + $iSpeed, 180) If Not $degree Then $iSpeed *= -1 EndIf EndFunc Func _Exit() AdlibUnRegister("Animate") _GDIPlus_PenDispose($hPen) _GDIPlus_BitmapDispose($hBitmap) _GDIPlus_GraphicsDispose($hContext) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete() Exit EndFunc Br, UEZ
    1 point
  2. Of course I have tried it and it worked. #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #include <GUIListViewEx.au3> #include <array.au3> Opt("GUIOnEventMode", 1) Opt("GUIResizeMode", 1) ;~ Global $WM_DROPFILES = 0x233 Global $DropFilesArr[1], $IDs[10], $counter=0 Local $FileList, $CancelB, $TitleC _GUICreate() _SetOnEvents() $sel_file_index = 0 While 1 Sleep(10) WEnd Func _GUICreate() #Region ### START Koda GUI section ### Form=Form2 (2).kxf $GUI = GUICreate("Akshay", 608, 376, -1, -1, -1, BitOR($WS_EX_ACCEPTFILES, "")) $TitleC = GUICtrlCreateInput("", 74, 59, 256, 25) ;, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL, $WS_GROUP)) $FileList = GUICtrlCreateListView("Name", 376, 8, 224, 360, BitOR($LVS_SHOWSELALWAYS, $WS_HSCROLL)) GUICtrlSendMsg(-1, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_HEADERDRAGDROP, $LVS_EX_HEADERDRAGDROP) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlSendMsg(-1, $LVM_SETCOLUMNWIDTH, 0, 150) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC") #EndRegion ### END Koda GUI section ### EndFunc ;==>_GUICreate Func _GUIDelete() GUIDelete() EndFunc ;==>_GUIDelete Func _Exit() Exit EndFunc ;==>_Exit Func _SetOnEvents() GUISetOnEvent($GUI_EVENT_DROPPED, "_DragFileFill") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") EndFunc ;==>_SetOnEvents Func _DragFileFill() $NotValidExtPath = "" $ValidExtCount = 0 For $i = 1 To UBound($DropFilesArr) - 1 ;~ If (UBound($IDs))>$counter Then ReDim $IDs[2*UBound($IDs)] ;~ ConsoleWrite("$counter=" & $counter) $ValidExtCount += 1 ;~ $counter=$counter+1 GUICtrlCreateListViewItem($DropFilesArr[$i], $FileList) GUICtrlSetOnEvent(-1,"Set") Next If $ValidExtCount > 0 Then GUICtrlSendMsg($FileList, $LVM_SETCOLUMNWIDTH, 0, -1) _GUICtrlListView_SetItemSelected($FileList, 0) EndFunc ;==>_DragFileFill Func _File_Selected() $sel_file_text = _GUICtrlListView_GetItemText($FileList, GUICtrlRead($FileList)) GUICtrlSetData($TitleC, $sel_file_text) EndFunc ;==>_File_Selected Func WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam) Local $nSize, $pFileName Local $nAmt = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", 0xFFFFFFFF, "ptr", 0, "int", 255) For $i = 0 To $nAmt[0] - 1 $nSize = DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", 0, "int", 0) $nSize = $nSize[0] + 1 $pFileName = DllStructCreate("char[" & $nSize & "]") DllCall("shell32.dll", "int", "DragQueryFile", "hwnd", $wParam, "int", $i, "ptr", _ DllStructGetPtr($pFileName), "int", $nSize) ReDim $DropFilesArr[$i + 2] $DropFilesArr[$i + 1] = DllStructGetData($pFileName, 1) $pFileName = 0 Next $DropFilesArr[0] = UBound($DropFilesArr) - 1 EndFunc ;==>WM_DROPFILES_FUNC Func Set() GUICtrlSetData($TitleC,GUICtrlRead(@GUI_CtrlId)) EndFunc I think that the function in you while loop you had, the one in the same line with If... , was for GUIRegister Message()
    1 point
  3. JohnOne

    The devs of autoit...

    pics or it didn't happen.
    1 point
  4. Valik

    The devs of autoit...

    Why are you guys freaking out and reporting the shit out of this? It was pretty clear that what's-his-face was quoting something (even before Richard and jchd confirmed it) and ac1dm4n is either quoting something else or responding in turn. Is all this stuff stupid pointless bullshit? Sure. Is it worth reporting? No. It's not serious stuff, it's just non-sense.
    1 point
×
×
  • Create New...