Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

ChooseFileFolder - New Version 25 Aug 14


  • Please log in to reply
115 replies to this topic

#1 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,463 posts

Posted 09 February 2011 - 06:34 PM

NEW VERSION 25 Aug 14

Changed: When using _CFF_Choose with a default folder the dialog is hidden until the tree expansion is completed (or abandoned). This prevents flickering as the tree is opened to the correct level.

Added: Again when using _CFF_Choose, adding 256 to the $iDisplay parameter shows small splash screens during any autoexpansion of the tree (see above) and when the UDF is searching if asked to show all available drives.

Thanks to qwert for the push to get these incorporated. thumbsup.gif

Note you need AutoIt v3.3.10.0 or later to run this release of the UDF as it will not run with earlier versions. wink.png

Previous versions: Attached File  ChangeLog.txt   9.58KB   12 downloads

 
I was fed up with using the native FileOpenDialog and FileSelectFolder which appeared anywhere on the screen in seemingly random sizes and often allowed users to select files from other than the path desired. So I decided to write my own version of an Explorer-type treeview and here it is: ChooseFileFolder.

What are the main advantages of this UDF over the normal dialogs?

- Common format for both file and folder selection.

- Ability to size and place the dialog where you want it rather than how Windows last left it.

- Ability to select (and delete) multiple items - even from different folders or drives. You can also select both files and folders from the same tree.

- And there is also a function to allow you to use an existing treeview in your own GUI to display the folder tree - no need to have a dialog at all.


Here is a zip file with the UDF and several example scripts: Attached File  ChooseFileFolder.zip   16.21KB   65 downloads

As usual happy to take feedback and, preferably, plaudits. biggrin.png

M23

Edited by Melba23, 25 August 2014 - 08:51 AM.

  • yahaosoft likes this
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items







#2 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,335 posts

Posted 10 February 2011 - 01:14 PM

Wouldn't expect any less! Purely brilliant, I am sure I will find some use for this UDF.

Edited by guinness, 10 February 2011 - 01:14 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 30/07/2014


#3 UEZ

UEZ

    Never say never

  • MVPs
  • 4,886 posts

Posted 10 February 2011 - 01:38 PM

I get an error on example 6 when I select my C drive ->

Line 419 (File "C:\Coding\AU3\GUI\ChooseFileFolder\ChooseFileFolder.au3"):

$hTreeView = GUICtrlCreateTreeView(0, 0, $iW - 20, $aTV_Pos[3])
$hTreeView = GUICtrlCreateTreeView(0, 0, $iW - 20, $aTV_Pos^ ERROR

Error: Subscript used with non-Array variable.

Btw, nice coding!

Br,
UEZ

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#4 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,463 posts

Posted 10 February 2011 - 02:02 PM

UEZ,

That has nothing to do with the C: drive - it is a result of an existing treeview not being found. :idiot:

I cannot reproduce it at the moment - which makes it a bit tricky to debug. When you first run Example 6 do you get a visible list control under a vertically moveable separator bar? Had you selected any other drive before your C: drive or was this the first one? :)

Aside from that, it must have taken an eternity to index the whole C: drive - I just did it once and nearly died of boredom. ;)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#5 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,335 posts

Posted 10 February 2011 - 02:10 PM

I selected another Drive and then the C:\ Drive and I didn't get the same error! I also repeated Example 6 with just selecting the C:\ Drive and still no problem. Very weird indeed why UEZ got this error.

Edited by guinness, 10 February 2011 - 02:10 PM.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 30/07/2014


#6 UEZ

UEZ

    Never say never

  • MVPs
  • 4,886 posts

Posted 10 February 2011 - 02:31 PM

I'm starting ChooseFileFolder_Ex.au3.

Ex 1: seems to be ok -> I can see the tree
Ex 2: seems to be ok -> I can see the tree
Ex 3: seems to be ok -> I can see the tree
Ex 4: seems not to be ok -> nothing is displayed -> $hTreeView = 0
Ex 5: no tree. I can select a drive and it starting to indexing it
Ex 6: no tree. I can select a drive. When I select my C drive the error appears. I've only one local drive - C. -> $hTreeView = 0
Ex 7: files are listed

Looks like there is no handle to the treeview.

If I find the the bug I will tell you!

Br,
UEZ

Edited by UEZ, 10 February 2011 - 02:32 PM.

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#7 UEZ

UEZ

    Never say never

  • MVPs
  • 4,886 posts

Posted 10 February 2011 - 02:49 PM

If you start Ex 6 with $sRet = _CFF_Choose("Ex 6: Select multiple files", 300, 500, -1, -1, "", Default, 0, True) it is working properly.

If $fSingle_Sel = False it will fail.

Test system: Win7 x64 with latest AutoIt version.

Ex 6 debug lines when $fSingle_Sel = False
@@ Debug(249) : $sRoot = >Error code: 0 @@ Debug(250) : $fSingle_Sel = False >Error code: 0 @@ Debug(325) : $hTreeView = 0 >Error code: 0 @@ Debug(326) : $hTreeView_Handle = 0 >Error code: 0


Ex 6 debug lines when $fSingle_Sel = True
@@ Debug(249) : $sRoot = >Error code: 0 @@ Debug(250) : $fSingle_Sel = True >Error code: 0 @@ Debug(325) : $hTreeView = 7 >Error code: 0 @@ Debug(326) : $hTreeView_Handle = 0x004A08CE >Error code: 0



Br,
UEZ

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#8 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,463 posts

Posted 10 February 2011 - 03:11 PM

UEZ,

It looks like the problem is in the GUIFrame UDF not this one, as you only have a problem when $fSingleSel = False. In that case, the UDF creates a treeview within a frame created by GUIFrame and this is obviously not happening.

Have you tried to run the GUIFrame UDF and its examples - if not could you please do do? I wonder if there is a problem with it on x64 systems - it uses many DllCalls so I would not be at all surprised. :)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#9 UEZ

UEZ

    Never say never

  • MVPs
  • 4,886 posts

Posted 10 February 2011 - 03:29 PM

I tested GUIFrame on following virtual machines:

WinXP x86 -> working properly
Win2003 x64 -> not working
Windows2008 x86 -> working

And on my notebook:
Win7 x64 -> not working

Seems to be a problem with x64 operating systems!

Em is:
C:\Coding\AU3\GUI\GUIFrame\GUIFrame_Example_1.au3 (17) : ==> Subscript used with non-Array variable.: GUICtrlCreateLabel("", 5, 5, $aWinSize[0] - 10, $aWinSize[1] - 10) GUICtrlCreateLabel("", 5, 5, $aWinSize^ ERROR


#AutoIt3Wrapper_UseX64=n will not help!

Br,
UEZ

 
The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯


#10 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,463 posts

Posted 10 February 2011 - 03:59 PM

UEZ,

Interesting. With some help from Yashied I thought the GUIFrame UDF was x64 compatible. - see here and the next few posts. :)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#11 guinness

guinness

    all-consuming swarm in inconspicuous disguise

  • Developers
  • 17,335 posts

Posted 10 February 2011 - 04:47 PM

I tested on x64 and it worked, but then I have a single drive with multiple partitions.

Example List: _AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrGeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()LockFile()Mapping CtrlIDsParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...
Updated: 30/07/2014


#12 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,463 posts

Posted 10 February 2011 - 05:11 PM

guinness,

Thanks for that. I have no other reports of the GUIFrames UDF not being x64 compatible after Yashied helped me fix it. ;)

The size of drive has nothing to do with it - it is a simple case of the treeview not being created as a result of GUIFrames failing to create the frame! So as the error is most certainly coming from that UDF (and the fact that UEZ cannot run that UDF on x64) I am wondering what is different with UEZ's machine. :)

M23

Edit: Typnig.

Edited by Melba23, 10 February 2011 - 05:13 PM.

StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items

#13 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,359 posts

Posted 10 February 2011 - 10:41 PM

Another nice UDF Melba. I looked into the x64 stuff.. the only issue I see is the same one as GUIListViewEx had with the NMHDR, and a simple 'Program Files' location change.

Here's the 'x64 compatible' change :) for double-click notifications to work properly in x64 mode:

Func _CFF_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)     #forceref $hWnd, $iMsg, $wParam     Local $tStruct = DllStructCreate("hwnd hWndFrom;uint_ptr IDFrom;int_ptr Code;int Spec", $lParam)     If @error Then Return     Switch BitAnd(DllStructGetData($tStruct, "Code"),0xFFFFFFFF)         Case 0xFFFFFFFD ; $NM_DBLCLK             $fCFF_DblClk = DllStructGetData($tStruct, "hWndFrom")     EndSwitch EndFunc   ;==>_CFF_WM_NOTIFY_Handler


And at the top of 'ChooseFileFolder_Ex.au3', you might put this:

Local $sProgFiles=@ProgramFilesDir If @AutoItX64 Then $sProgFiles&=' (x86)'


..and then change any occurrences of @ProgramFilesDir to $sProgFiles. This change is due to the fact that AutoIt installs in the x86 Program Files folder ('C:\Program Files (x86)") on 64-bit O/S's. In x86 mode, that's where it looks by default, but not in x64 mode. This will give your example the ability to run the same in both bit modes.

*edit: oops, meant 'double' click

Edited by Ascend4nt, 10 February 2011 - 10:45 PM.


#14 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 11 February 2011 - 08:38 AM

You can't. The "Code" member in NMHDR structure requires four bytes (UINT). At least it did not correctly. Just replace UINT to INT. BTW, exactly in this form, NMHDR structure is defined in StructureConstants.au3.

Func _CFF_WM_NOTIFY_Handler($hWnd, $iMsg, $wParam, $lParam)     #forceref $hWnd, $iMsg, $wParam     Local $tStruct = DllStructCreate("hwnd hWndFrom;uint_ptr IDFrom;int Code", $lParam)     Switch DllStructGetData($tStruct, "Code")         Case -3 ; $NM_DBLCLK             $fCFF_DblClk = DllStructGetData($tStruct, "hWndFrom")     EndSwitch EndFunc   ;==>_CFF_WM_NOTIFY_Handler

And the following condition is unnecessary.


If the pointer is invalid (not zero), you get a garbage in the structure or crash with "Access is denied", but not @error.

Edited by Yashied, 11 February 2011 - 08:52 AM.


#15 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,359 posts

Posted 11 February 2011 - 08:45 AM

'INT' is 4 bytes. NMHDR changed in x64 so that the last item is 8 bytes (int_ptr), and apparently without notifying anyone. The MSDN info is wrong.

The 'Spec' item was Melba's addition, I just kept it in there in case that was what he was going to use someday if it points to a larger struct.

Ahh, and the @error thing is Melba's idea, not mine - I only left it as it was coded.

*edit: for reference, you can look at my post on Melba's GuiListViewEx thread.

Edited by Ascend4nt, 11 February 2011 - 08:51 AM.


#16 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 11 February 2011 - 08:51 AM

'INT' is 4 bytes.

Yes of course, I wanted to say a double word.

:)

#17 Ascend4nt

Ascend4nt

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 1,359 posts

Posted 11 February 2011 - 08:56 AM

BTW, exactly in this form, NMHDR structure is defined in StructureConstants.au3.

Yeah, that's an issue that has supposedly been fixed in 3.3.7.0, check out ticket # 1479 regarding WM_NOTIFY. For now I've manually edited my AutoIt Includes to fix that problem, since it seems unlikely we'll see a new version of AutoIt released any time soon.

#18 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 11 February 2011 - 09:50 AM

Yes, you are right, this is an alignments problem under x64 (similar problem). But the Melba23's problem in this case in the following.

"int IDFrom" instead of "uint_ptr IDFrom".

Thanks for the links.

:)

#19 Yashied

Yashied

    Happy in Moscow

  • MVPs
  • 2,574 posts

Posted 11 February 2011 - 12:51 PM

I think MSDN is correct, NMHDR structure looks like this.

$tagNMHDR = "hwnd hWndFrom;uint_ptr IDFrom;int Code"

But the following structures that includes NMHDR must be aligned to sizeof(ptr). For example

; x64 $tagNMHEADER = $tagNMHDR & ";byte Alignment[4];int Item;int Button;ptr pItem" ; x86 $tagNMHEADER = $tagNMHDR & ";int Item;int Button;ptr pItem"


#20 Melba23

Melba23

    I'm old - what's your excuse?

  • Moderators
  • 21,463 posts

Posted 11 February 2011 - 01:14 PM

Ascend4nt and Yashied,

Thank you both for your efforts. :)

I mentioned a tutorial on this x64 compatability problem to enlighten hobbyist coders like me the last time it came up - I suppose both of you are still not interested in writing one? :idiot:

New UDF and example in the first post. ;)

M23
StringSize - Automatically size controls to fit text                                                               ExtMsgBox - A user customisable replacement for MsgBox
Toast - Small GUIs which pop out of the Systray                                                                Marquee - Scrolling tickertape GUIs
Scrollbars - Automatically sized scrollbars with a single command                                   GUIFrame - Subdivide GUIs into many adjustable frames
GUIExtender - Extend and retract multiple sections within a GUI                                      NoFocusLines - Remove the dotted focus lines from buttons, sliders, radios and checkboxes
ChooseFileFolder - Single and multiple selections from specified path tree structure      Notify - Small notifications on the edge of the display
Date_Time_Convert - Easily convert date/time formats, including the language               GUIListViewEx - Insert, delete, move, drag, sort and edit ListView items




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users