Jump to content
Sign in to follow this  

LV-Fields are flickering ....

Recommended Posts


I want to change a bigger script (at least form me) to $GUI_DROPACCEPTED based on examples for Global $WM_DROPFILES = 0x233.

Perhaps someone can have a look at the following extracted scriptlines with the LV-fields flicker.

If I do the same on one Main_GUI with a LV on a tab it works fine (-without flickering -), but if it is possible I want to keep the structure of the script and not rewrite all.

Is there any know limitation that $GUI_DROPACCEPTED / $WM_DROPFILES works only ont he Main_GUI.

Best regards, Reinhard

Edit: Forgot to remark that without Case $GUI_EVENT_DROPPED the Tabs are working fine.

#include <GUIConstants.au3>
#include <GuiTreeView.au3>
#include <GuiListView.au3>
#include <Array.au3>

Global $WM_DROPFILES = 0x233
Global $gaDropFiles[1]

Global $main_GUI,$ok_button,$cancel_button,$Scripts_GUI, $Boomarks_GuI,$aTree,$hTree, $Files_GUI, $Info

$main_GUI = GUICreate("PDF Manager",560,520,20,20,BitOr($GUI_SS_DEFAULT_GUI,$WS_CLIPSIBLINGS))
;GUICtrlCreateGroup ( "", 1, 1,550,1); MENU 
    $MMenF = GUICtrlCreateMenu ("&File")
        $MMenFO = GUICtrlCreateMenuitem ("Open",$MMenF)
        $MMenFS1 = GUICtrlCreateMenuitem ("",$MMenF,2)
        $MMenFR = GUICtrlCreateMenu ("Recent Files",$MMenF,1)
        $MMenFE = GUICtrlCreateMenuitem ("Exit",$MMenF)
    $MMenE = GuiCtrlCreateMenu("&Edit")
    $MMenT = GuiCtrlCreateMenu("&Tools")
        $MMenTE = GUICtrlCreateMenuitem ("Explorer",$MMenT)
        $MMenTB = GUICtrlCreateMenuitem ("MetaEdit",$MMenT)
    $MMenH = GuiCtrlCreateMenu("&Help")
    $Button_6 = GuiCtrlCreateButton("", 0, 1, 560, 2, -1, $WS_EX_STATICEDGE)
    $OutputFileLab = GUICtrlCreateLabel ("Output File:", 10, 455,-1,-1,$SS_NOTIFY)
    GUICtrlSetTip ($OutputFileLab, "Click here to select an Output file")
    $OutputFile = GUICtrlCreateInput ("C:\Test.pdf", 70, 455, 350, 20)
    $Ok_button = GUICtrlCreateButton("OK",428,455,60,20)
    $cancel_button = GUICtrlCreateButton("Cancel",490,455,60,20)
    $Info = "LV=No Files  BM=No"
    $Status = GUICtrlCreateLabel($Info,10,440+40,540,15,BitOR($SS_SUNKEN, $SS_Center))
;;;;;;;;;;; ==> End of Main GUI Definition;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

$Files_GUI = GUICreate("",520,400,20,40, $WS_CHILD,$WS_EX_ACCEPTFILES,$main_GUI)
    GUISetBkColor(0xA0A0B0); just for dimensing the child
    $listview = GUICtrlCreateListView ("Filename|SelPg  |Pg|BM|Date |Path          ",10,10,500,205, _ 
    GUICtrlSetState(-1,$GUI_DROPACCEPTED)  ; to allow drag and dropping

; creates the Boomarks child window that is implemented into the main GUI
$Boomarks_GUI   = GUICreate("",520,400,20,40,$WS_CHILD,-1,$main_GUI)
         GUISetBkColor(0xA0D0B0); just for dimensing the child

; creates the Scripts tab window that is implemented into the main GUI
$Scripts_GUI    = GUICreate("",520,400,20,40,$WS_CHILD,-1,$main_GUI);$WS_CHILD,
GUISetBkColor(0x257788); just for dimensing the child

; creates the Settings window that is implemented into the main GUI
$Settings_GUI   = GUICreate("",520,400,20,40,$WS_CHILD,-1,$main_GUI)
GUISetBkColor(0xCFA0B0); just for dimensing the child

$main_tab   = GUICtrlCreateTab(10,10,540,440)
    $Files_tab = GUICtrlCreateTabItem("Files")
    $Boomarks_tab  = GUICtrlCreateTabItem("Boomarks")
    $Scripts_tab  = GUICtrlCreateTabItem("Scripts")
    $Settings_tab  = GUICtrlCreateTabItem("Settings")

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MAIN GUI LOOP;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
While 1
    $msg = GUIGetMsg()
    Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancel_button or $msg = $MMenFE
;   msgbox(0,"","Dropped")
        For $i = 0 To UBound($gaDropFiles) - 1
            GUICtrlCreateListViewItem($gaDropFiles[$i], $Listview)
    Case $msg = $main_tab
         $tab_item = GUICtrlRead($main_tab)
    Case $tab_item = 0
    Case $tab_item  = 1
        ;GUICtrlSetState($Expand_button, $GUI_HIDE)
    Case $tab_item  = 2
        ;GUICtrlSetState($Expand_button, $GUI_HIDE)
    Case $tab_item  = 3
WEnd  ;;;; <= End GUI Loop

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 $gaDropFiles[$i + 1]
        $gaDropFiles[$i] = DllStructGetData($pFileName, 1)
        $pFileName = 0
Edited by ReFran

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Create New...